From 78c948581e8da46e45f377c21252716a9760625c Mon Sep 17 00:00:00 2001 From: Sarah Morgan Date: Tue, 12 Sep 2023 09:27:31 -0600 Subject: [PATCH] Draft: Refactor Quality Measures Mart to add clinical data (#202) * Data model changes * Add support for clinical staging models * Fix table aliases * Remove claims preprocessing model that doesn't exist from yml to fix warning * Add logic to intermediate models for core clinical tables * Remove "reporting" references * Add snapshots and bump package version * added new docs files --------- Co-authored-by: tuvaforrest --- dbt_project.yml | 7 +- docs/catalog.json | 2 +- docs/manifest.json | 2 +- docs/run_results.json | 2 +- integration_tests/dbt_project.yml | 7 +- .../claims_preprocessing_models.yml | 11 - .../quality_measures__summary_counts.sql} | 36 +- .../quality_measures__summary_long.sql} | 4 +- .../quality_measures__summary_wide.sql} | 4 +- ...ity_measures__int_nqf2372_denominator.sql} | 112 +++- ...__int_nqf2372_exclude_advanced_illness.sql | 512 ++++++++++++++++++ ...measures__int_nqf2372_exclude_dementia.sql | 384 +++++++++++++ ...measures__int_nqf2372_exclude_hospice.sql} | 102 ++-- ...es__int_nqf2372_exclude_institutional.sql} | 7 +- ...asures__int_nqf2372_exclude_mastectomy.sql | 177 ++++++ ...asures__int_nqf2372_exclude_palliative.sql | 182 +++++++ ...lity_measures__int_nqf2372_exclusions.sql} | 28 +- .../quality_measures__int_nqf2372_long.sql} | 10 +- ...uality_measures__int_nqf2372_numerator.sql | 209 +++++++ ...models.yml => quality_measures_models.yml} | 249 +++++---- ...__int_nqf2372_exclude_advanced_illness.sql | 358 ------------ ...eporting__int_nqf2372_exclude_dementia.sql | 248 --------- ...orting__int_nqf2372_exclude_mastectomy.sql | 137 ----- ...orting__int_nqf2372_exclude_palliative.sql | 146 ----- ...sures_reporting__int_nqf2372_numerator.sql | 158 ------ ...easures_reporting__stg_core__condition.sql | 12 - ...easures_reporting__stg_core__procedure.sql | 11 - ..._measures_reporting__stg_medical_claim.sql | 13 - ...measures_reporting__stg_pharmacy_claim.sql | 11 - .../quality_measures__stg_core__condition.sql | 14 + .../quality_measures__stg_core__encounter.sql | 36 ++ ...quality_measures__stg_core__medication.sql | 42 ++ ...uality_measures__stg_core__observation.sql | 42 ++ .../quality_measures__stg_core__patient.sql} | 4 +- .../quality_measures__stg_core__procedure.sql | 13 + .../quality_measures__stg_medical_claim.sql | 42 ++ .../quality_measures__stg_pharmacy_claim.sql | 36 ++ .../quality_measures__concepts.csv} | 0 .../quality_measures__measures.csv} | 0 .../quality_measures__value_sets.csv} | 0 .../quality_measures_seeds.yml | 32 ++ .../quality_measures_reporting_seeds.yml | 32 -- ...lity_measures__summary_counts_snapshot.sql | 21 + ...uality_measures__summary_long_snapshot.sql | 21 + 44 files changed, 2116 insertions(+), 1360 deletions(-) rename models/quality_measures/{quality_measures_reporting/final/quality_measures_reporting__summary_counts.sql => final/quality_measures__summary_counts.sql} (69%) rename models/quality_measures/{quality_measures_reporting/final/quality_measures_reporting__summary_long.sql => final/quality_measures__summary_long.sql} (87%) rename models/quality_measures/{quality_measures_reporting/final/quality_measures_reporting__summary_wide.sql => final/quality_measures__summary_wide.sql} (86%) rename models/quality_measures/{quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_denominator.sql => intermediate/quality_measures__int_nqf2372_denominator.sql} (54%) create mode 100644 models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_advanced_illness.sql create mode 100644 models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_dementia.sql rename models/quality_measures/{quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_hospice.sql => intermediate/quality_measures__int_nqf2372_exclude_hospice.sql} (52%) rename models/quality_measures/{quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_institutional.sql => intermediate/quality_measures__int_nqf2372_exclude_institutional.sql} (83%) create mode 100644 models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_mastectomy.sql create mode 100644 models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_palliative.sql rename models/quality_measures/{quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclusions.sql => intermediate/quality_measures__int_nqf2372_exclusions.sql} (84%) rename models/quality_measures/{quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_long.sql => intermediate/quality_measures__int_nqf2372_long.sql} (91%) create mode 100644 models/quality_measures/intermediate/quality_measures__int_nqf2372_numerator.sql rename models/quality_measures/{quality_measures_reporting/quality_measures_reporting_models.yml => quality_measures_models.yml} (73%) delete mode 100644 models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql delete mode 100644 models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_dementia.sql delete mode 100644 models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql delete mode 100644 models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_palliative.sql delete mode 100644 models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_numerator.sql delete mode 100644 models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__condition.sql delete mode 100644 models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__procedure.sql delete mode 100644 models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_medical_claim.sql delete mode 100644 models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_pharmacy_claim.sql create mode 100644 models/quality_measures/staging/quality_measures__stg_core__condition.sql create mode 100644 models/quality_measures/staging/quality_measures__stg_core__encounter.sql create mode 100644 models/quality_measures/staging/quality_measures__stg_core__medication.sql create mode 100644 models/quality_measures/staging/quality_measures__stg_core__observation.sql rename models/quality_measures/{quality_measures_reporting/staging/quality_measures_reporting__stg_core__patient.sql => staging/quality_measures__stg_core__patient.sql} (54%) create mode 100644 models/quality_measures/staging/quality_measures__stg_core__procedure.sql create mode 100644 models/quality_measures/staging/quality_measures__stg_medical_claim.sql create mode 100644 models/quality_measures/staging/quality_measures__stg_pharmacy_claim.sql rename seeds/value_sets/{quality_measures_reporting/quality_measures_reporting__concepts.csv => quality_measures/quality_measures__concepts.csv} (100%) rename seeds/value_sets/{quality_measures_reporting/quality_measures_reporting__measures.csv => quality_measures/quality_measures__measures.csv} (100%) rename seeds/value_sets/{quality_measures_reporting/quality_measures_reporting__value_sets.csv => quality_measures/quality_measures__value_sets.csv} (100%) create mode 100644 seeds/value_sets/quality_measures/quality_measures_seeds.yml delete mode 100644 seeds/value_sets/quality_measures_reporting/quality_measures_reporting_seeds.yml create mode 100644 snapshots/quality_measures/quality_measures__summary_counts_snapshot.sql create mode 100644 snapshots/quality_measures/quality_measures__summary_long_snapshot.sql diff --git a/dbt_project.yml b/dbt_project.yml index 965735da4..7ed7a1f06 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'the_tuva_project' -version: '0.5.1' +version: '0.5.2' config-version: 2 require-dbt-version: ">=1.3.0" @@ -34,8 +34,9 @@ vars: tuva_last_run: '{{ run_started_at.astimezone(modules.pytz.timezone("UTC")) }}' ## Quality Measure data mart vars - # The measurement period variable has a default of the current date - quality_measure_reporting_period_end: "{{ dbt_utils.pretty_time(format='%Y-%m-%d') }}" + # The measurement period end variable has a default of the current date + # this var can be used to run older performance periods + quality_measures_period_end: "{{ dbt_utils.pretty_time(format='%Y-%m-%d') }}" model-paths: ["models"] diff --git a/docs/catalog.json b/docs/catalog.json index 78dee99d2..8fd21ef4b 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.4.5", "generated_at": "2023-09-05T20:36:35.435434Z", "invocation_id": "7dbcd19b-84c8-4503-9168-34bb61671a78", "env": {}}, "nodes": {"model.the_tuva_project.core__procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.claims_data_model.medication": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "TEXT", "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": "TEXT", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "TEXT", "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": "TEXT", "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.claims_data_model.medication"}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ADJUSTMENT_RATES", "database": "TUVA", "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": "FLOAT", "index": 3, "name": "NORMALIZATION_FACTOR", "comment": null}, "MA_CODING_PATTERN_ADJUSTMENT": {"type": "FLOAT", "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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, "model.the_tuva_project.core__stg_claims_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "TEXT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "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_claims_patient"}, "model.the_tuva_project.quality_measures_reporting__summary_counts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "SUMMARY_COUNTS", "database": "TUVA", "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}, "PERFORMANCE_RATE": {"type": "NUMBER", "index": 8, "name": "PERFORMANCE_RATE", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__summary_counts"}, "model.the_tuva_project.core__medication": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "TEXT", "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": "TEXT", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "TEXT", "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": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.cms_hcc__enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ENROLLMENT_INTERACTION_FACTORS", "database": "TUVA", "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}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "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": 7.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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ENROLLMENT_INTERACTION_FACTORS", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.terminology__code_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CODE_TYPE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__code_type"}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUDE_HOSPICE", "database": "TUVA", "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}}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclude_hospice"}, "model.the_tuva_project.service_category__combined_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.readmissions__diagnosis_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_DIAGNOSIS_CCS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CODE": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CODE", "comment": null}, "DIAGNOSIS_RANK": {"type": "NUMBER", "index": 3, "name": "DIAGNOSIS_RANK", "comment": null}, "VALID_ICD_10_CM_FLAG": {"type": "NUMBER", "index": 4, "name": "VALID_ICD_10_CM_FLAG", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 5, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "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__diagnosis_ccs"}, "model.the_tuva_project.core__stg_clinical_medication": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "TEXT", "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": "TEXT", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "TEXT", "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": "TEXT", "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.service_category__skilled_nursing_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__inpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_PSYCHIATRIC_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.chronic_conditions__cms_chronic_conditions_hiv_aids": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_HIV_AIDS", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.acute_inpatient__data_quality_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_DATA_QUALITY_SUMMARY", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__gender": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "GENDER", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__gender"}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_CCS", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, "model.claims_data_model.eligibility": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "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.claims_data_model.eligibility"}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUDE_PALLIATIVE", "database": "TUVA", "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}}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclude_palliative"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_LONG", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__professional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAIL_DETAILS", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__professional_header_fail_details"}, "model.the_tuva_project.data_profiling__institutional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAILURES", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 138, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__institutional_header_failures"}, "model.the_tuva_project.core__stg_clinical_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "TEXT", "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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "TEXT", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "TEXT", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "TEXT", "index": 23, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 24, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 25, "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"}, "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": "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.quality_measures_reporting__int_nqf2372_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_DENOMINATOR", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_denominator"}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_CPT_HCPCS", "database": "TUVA", "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": 32741.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 89600.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, "model.the_tuva_project.core__stg_claims_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "TUVA_LAST_RUN": {"type": "TEXT", "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_claims_procedure"}, "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__pharmacy_claim_missing_values"}, "model.the_tuva_project.service_category__urgent_care_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_data_model.observation": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "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": "TEXT", "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.claims_data_model.observation"}, "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": "TUVA", "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": 36.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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_DUAL_ELIGIBILITY", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, "model.the_tuva_project.readmissions__encounter_overlap": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_OVERLAP", "database": "TUVA", "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_profiling__test_detail_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_MEDICAL_CLAIM", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_detail_stage_medical_claim"}, "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_ELIGIBILITY", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_detail_stage_eligibility"}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_UNMAPPED", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__claim_type_unmapped"}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 6, "name": "COEFFICIENT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__dme_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DME_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.financial_pmpm__pmpm": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 2, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "FLOAT", "index": 3, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "FLOAT", "index": 4, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "FLOAT", "index": 5, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "FLOAT", "index": 6, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "FLOAT", "index": 7, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "FLOAT", "index": 8, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "FLOAT", "index": 9, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "FLOAT", "index": 10, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "FLOAT", "index": 11, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "FLOAT", "index": 12, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "FLOAT", "index": 13, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "FLOAT", "index": 14, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "FLOAT", "index": 15, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "FLOAT", "index": 16, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "FLOAT", "index": 17, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "FLOAT", "index": 18, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "FLOAT", "index": 19, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "FLOAT", "index": 20, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "FLOAT", "index": 21, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "FLOAT", "index": 22, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "FLOAT", "index": 23, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "FLOAT", "index": 24, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "FLOAT", "index": 25, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "FLOAT", "index": 26, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "FLOAT", "index": 27, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "FLOAT", "index": 28, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "FLOAT", "index": 29, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "FLOAT", "index": 30, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "FLOAT", "index": 31, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "FLOAT", "index": 32, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "FLOAT", "index": 33, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "FLOAT", "index": 34, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "FLOAT", "index": 35, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "FLOAT", "index": 36, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "FLOAT", "index": 37, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "FLOAT", "index": 38, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "FLOAT", "index": 39, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "FLOAT", "index": 40, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "FLOAT", "index": 41, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "FLOAT", "index": 42, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "FLOAT", "index": 43, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "FLOAT", "index": 44, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "FLOAT", "index": 45, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "FLOAT", "index": 46, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "FLOAT", "index": 47, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "FLOAT", "index": 48, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "FLOAT", "index": 49, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "FLOAT", "index": 50, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "FLOAT", "index": 51, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "FLOAT", "index": 52, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 53, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, "model.claims_data_model.encounter": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "TEXT", "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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "TEXT", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "TEXT", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "TEXT", "index": 23, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 24, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 25, "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.claims_data_model.encounter"}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_SPECIALTY_COHORT", "database": "TUVA", "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.claims_date_profiling__date_issues": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "DATE_ISSUES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DESCRIPTION": {"type": "TEXT", "index": 1, "name": "TEST_DESCRIPTION", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "CLAIM_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": 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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__date_issues"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, "model.the_tuva_project.data_profiling__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SUMMARY", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__summary"}, "seed.claims_data_model.medical_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "TUVA_SYNTHETIC", "name": "MEDICAL_CLAIM_SEED", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "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": "2023-09-05 16: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": "seed.claims_data_model.medical_claim_seed"}, "model.claims_data_model.practitioner": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "TUVA_LAST_RUN": {"type": "TEXT", "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.claims_data_model.practitioner"}, "model.the_tuva_project.service_category__office_visit_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OFFICE_VISIT_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "TUVA", "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}, "INPATIENT_ALLOWED": {"type": "FLOAT", "index": 3, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "FLOAT", "index": 4, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "FLOAT", "index": 5, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "FLOAT", "index": 6, "name": "ANCILLARY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "FLOAT", "index": 7, "name": "OTHER_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "FLOAT", "index": 8, "name": "PHARMACY_ALLOWED", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__dq_multiple_service_categories_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_OUD", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "HCPCS_LEVEL_2", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__hcpcs_level_2"}, "seed.the_tuva_project.terminology__ms_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MS_DRG", "database": "TUVA", "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": 797.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": "2023-09-05 17:00UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.readmissions__exclusion": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_EXCLUSION", "database": "TUVA", "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.core__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 11, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 12, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 13, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 14, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 17, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 18, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 19, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 20, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 21, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 22, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 23, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 24, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 30, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 31, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 32, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 33, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 34, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 35, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "CHARGE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 37, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 38, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 39, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__emergency_department_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__payer_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PAYER_TYPE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__payer_type"}, "model.the_tuva_project.service_category__dq_input_layer_results": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_RESULTS", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.core__stg_clinical_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "TEXT", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "TEXT", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "TEXT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "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.core__condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "TEXT", "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": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__ambulatory_surgery_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULATORY_SURGERY_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.core__stg_claims_pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 14, "name": "ALLOWED_AMOUNT", "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": {"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_claims_pharmacy_claim"}, "model.the_tuva_project.acute_inpatient__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "ACUTE_INPATIENT_SUMMARY", "database": "TUVA", "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}, "FACILITY_NPI": {"type": "TEXT", "index": 8, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 9, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 10, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 11, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 13, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 14, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 16, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 20, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 22, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 23, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 24, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 25, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 26, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.readmissions__exclusion_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_EXCLUSION_CCS_DIAGNOSIS_CATEGORY", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, "model.the_tuva_project.cms_hcc__int_members": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_MEMBERS", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 12, "name": "MODEL_VERSION", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.core__stg_claims_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 23, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 24, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 25, "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_claims_encounter"}, "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": "TUVA", "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}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 4, "name": "SERVICE_CATEGORY_2", "comment": null}, "TOTAL_PAID": {"type": "FLOAT", "index": 5, "name": "TOTAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "FLOAT", "index": 6, "name": "TOTAL_ALLOWED", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__test_catalog": {"metadata": {"type": "BASE TABLE", "schema": "DATA_PROFILING", "name": "_VALUE_SET_TEST_CATALOG", "database": "TUVA", "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}, "MEDICAL_CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "MEDICAL_CLAIM_TYPE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 242.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": "2023-09-05 16: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": "seed.the_tuva_project.data_profiling__test_catalog"}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_TESTS", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__eligibility_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_INVALID_VALUES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 6, "name": "PATIENT_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 7, "name": "GENDER", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 8, "name": "FILLED_ROW_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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__eligibility_invalid_values"}, "model.the_tuva_project.core__encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "TEXT", "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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "TEXT", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "TEXT", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "TEXT", "index": 23, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 24, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 25, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "TUVA", "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.service_category__dq_multiple_service_categories_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__mdc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MDC", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__mdc"}, "seed.the_tuva_project.terminology__ssa_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SSA_FIPS_STATE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__ssa_fips_state"}, "model.the_tuva_project.data_profiling__test_detail": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_DETAIL", "database": "TUVA", "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}, "FOREIGN_KEY": {"type": "TEXT", "index": 6, "name": "FOREIGN_KEY", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_detail"}, "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": "TUVA", "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}, "ACUTE_INPATIENT_ALLOWED": {"type": "FLOAT", "index": 3, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "FLOAT", "index": 4, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "FLOAT", "index": 5, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "FLOAT", "index": 6, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "FLOAT", "index": 7, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "FLOAT", "index": 8, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "FLOAT", "index": 9, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "FLOAT", "index": 10, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "FLOAT", "index": 11, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "FLOAT", "index": 12, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "FLOAT", "index": 13, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "FLOAT", "index": 14, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "FLOAT", "index": 15, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "FLOAT", "index": 16, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "FLOAT", "index": 17, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "FLOAT", "index": 18, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "FLOAT", "index": 19, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.ccsr__procedure_category_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "PROCEDURE_CATEGORY_MAP", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_result_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_ELIGIBILITY", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_result_stage_eligibility"}, "model.the_tuva_project.service_category__urgent_care_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__pharmacy_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_DUPLICATES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__pharmacy_claim_duplicates"}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUDE_INSTITUTIONAL", "database": "TUVA", "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}}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclude_institutional"}, "model.the_tuva_project.acute_inpatient__encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_ID", "database": "TUVA", "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}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "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.acute_inpatient__encounter_id"}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_COUNT_FACTORS", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__apr_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "APR_DRG", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"APR_DRG_CODE": {"type": "TEXT", "index": 1, "name": "APR_DRG_CODE", "comment": null}, "SEVERITY": {"type": "TEXT", "index": 2, "name": "SEVERITY", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "APR_DRG_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1272.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 12288.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 17:00UTC", "include": true, "description": "The timestamp for last update/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.terminology__other_provider_taxonomy": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "OTHER_PROVIDER_TAXONOMY", "database": "TUVA", "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": 9254795.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 67061248.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16:57UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__ansi_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ANSI_FIPS_STATE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__ansi_fips_state"}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISABLED_INTERACTION_FACTORS", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__medical_claim_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DENOMINATORS", "database": "TUVA", "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": 14.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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__medical_claim_denominators"}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DUPLICATES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__eligibility_duplicates"}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_HIERARCHY", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "TUVA", "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}, "ACUTE_INPATIENT_PAID": {"type": "FLOAT", "index": 3, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "FLOAT", "index": 4, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "FLOAT", "index": 5, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "FLOAT", "index": 6, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "FLOAT", "index": 7, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "FLOAT", "index": 8, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "FLOAT", "index": 9, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "FLOAT", "index": 10, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "FLOAT", "index": 11, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "FLOAT", "index": 12, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "FLOAT", "index": 13, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "FLOAT", "index": 14, "name": "OFFICE_VISIT_PAID", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "FLOAT", "index": 15, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "FLOAT", "index": 16, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "FLOAT", "index": 17, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "FLOAT", "index": 18, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "FLOAT", "index": 19, "name": "URGENT_CARE_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.claims_data_model.medical_claim": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "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.claims_data_model.medical_claim"}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "DX_VERTICAL_PIVOT", "database": "TUVA", "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": 2373632.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.terminology__race": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RACE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__race"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_LONG", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION_FAMILY": {"type": "TEXT", "index": 2, "name": "CONDITION_FAMILY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 3, "name": "CONDITION", "comment": null}, "FIRST_DIAGNOSIS_DATE": {"type": "DATE", "index": 4, "name": "FIRST_DIAGNOSIS_DATE", "comment": null}, "LAST_DIAGNOSIS_DATE": {"type": "DATE", "index": 5, "name": "LAST_DIAGNOSIS_DATE", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.core__practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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": "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.quality_measures_reporting__measures": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_VALUE_SET_MEASURES", "database": "TUVA", "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": "NUMBER", "index": 4, "name": "VERSION", "comment": null}, "STEWARD": {"type": "TEXT", "index": 5, "name": "STEWARD", "comment": null}, "COMPATIBLE_MEASURE": {"type": "TEXT", "index": 6, "name": "COMPATIBLE_MEASURE", "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": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.quality_measures_reporting__measures"}, "model.the_tuva_project.service_category__dialysis_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__admit_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_TYPE", "database": "TUVA", "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": 9.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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__admit_type"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, "model.the_tuva_project.core__stg_claims_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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": "TEXT", "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_claims_practitioner"}, "seed.the_tuva_project.terminology__icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_CM", "database": "TUVA", "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": 74044.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1063936.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 17:00UTC", "include": true, "description": "The timestamp for last update/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.acute_inpatient__encounter_data_for_medical_claims": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ENCOUNTER_DATA_FOR_MEDICAL_CLAIMS", "database": "TUVA", "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.cms_hcc__int_disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_INTERACTION_FACTORS", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_result_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_PHARMACY_CLAIM", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_result_stage_pharmacy_claim"}, "model.the_tuva_project.core__stg_claims_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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": "TEXT", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "TEXT", "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": "TEXT", "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_claims_condition"}, "model.the_tuva_project.core__stg_clinical_lab_result": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "TEXT", "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": "TEXT", "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.claims_data_model.lab_result": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "TEXT", "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": "TEXT", "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.claims_data_model.lab_result"}, "seed.claims_data_model.pharmacy_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "TUVA_SYNTHETIC", "name": "PHARMACY_CLAIM_SEED", "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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 14, "name": "ALLOWED_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "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": "2023-09-05 16: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": "seed.claims_data_model.pharmacy_claim_seed"}, "seed.the_tuva_project.terminology__calendar": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CALENDAR", "database": "TUVA", "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}, "DATE": {"type": "NUMBER", "index": 4, "name": "DATE", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__calendar"}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_MAPPING", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SURGERY_GYNECOLOGY_COHORT", "database": "TUVA", "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": 1676.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 28672.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_REHAB_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.ccsr__wide_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "WIDE_CONDITION_CATEGORY", "database": "TUVA", "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}, "DXCCSR_BLD001": {"type": "NUMBER", "index": 4, "name": "DXCCSR_BLD001", "comment": null}, "DXCCSR_BLD002": {"type": "NUMBER", "index": 5, "name": "DXCCSR_BLD002", "comment": null}, "DXCCSR_BLD003": {"type": "NUMBER", "index": 6, "name": "DXCCSR_BLD003", "comment": null}, "DXCCSR_BLD004": {"type": "NUMBER", "index": 7, "name": "DXCCSR_BLD004", "comment": null}, "DXCCSR_BLD005": {"type": "NUMBER", "index": 8, "name": "DXCCSR_BLD005", "comment": null}, "DXCCSR_BLD006": {"type": "NUMBER", "index": 9, "name": "DXCCSR_BLD006", "comment": null}, "DXCCSR_BLD007": {"type": "NUMBER", "index": 10, "name": "DXCCSR_BLD007", "comment": null}, "DXCCSR_BLD008": {"type": "NUMBER", "index": 11, "name": "DXCCSR_BLD008", "comment": null}, "DXCCSR_BLD009": {"type": "NUMBER", "index": 12, "name": "DXCCSR_BLD009", "comment": null}, "DXCCSR_BLD010": {"type": "NUMBER", "index": 13, "name": "DXCCSR_BLD010", "comment": null}, "DXCCSR_CIR001": {"type": "NUMBER", "index": 14, "name": "DXCCSR_CIR001", "comment": null}, "DXCCSR_CIR002": {"type": "NUMBER", "index": 15, "name": "DXCCSR_CIR002", "comment": null}, "DXCCSR_CIR003": {"type": "NUMBER", "index": 16, "name": "DXCCSR_CIR003", "comment": null}, "DXCCSR_CIR004": {"type": "NUMBER", "index": 17, "name": "DXCCSR_CIR004", "comment": null}, "DXCCSR_CIR005": {"type": "NUMBER", "index": 18, "name": "DXCCSR_CIR005", "comment": null}, "DXCCSR_CIR006": {"type": "NUMBER", "index": 19, "name": "DXCCSR_CIR006", "comment": null}, "DXCCSR_CIR007": {"type": "NUMBER", "index": 20, "name": "DXCCSR_CIR007", "comment": null}, "DXCCSR_CIR008": {"type": "NUMBER", "index": 21, "name": "DXCCSR_CIR008", "comment": null}, "DXCCSR_CIR009": {"type": "NUMBER", "index": 22, "name": "DXCCSR_CIR009", "comment": null}, "DXCCSR_CIR010": {"type": "NUMBER", "index": 23, "name": "DXCCSR_CIR010", "comment": null}, "DXCCSR_CIR011": {"type": "NUMBER", "index": 24, "name": "DXCCSR_CIR011", "comment": null}, "DXCCSR_CIR012": {"type": "NUMBER", "index": 25, "name": "DXCCSR_CIR012", "comment": null}, "DXCCSR_CIR013": {"type": "NUMBER", "index": 26, "name": "DXCCSR_CIR013", "comment": null}, "DXCCSR_CIR014": {"type": "NUMBER", "index": 27, "name": "DXCCSR_CIR014", "comment": null}, "DXCCSR_CIR015": {"type": "NUMBER", "index": 28, "name": "DXCCSR_CIR015", "comment": null}, "DXCCSR_CIR016": {"type": "NUMBER", "index": 29, "name": "DXCCSR_CIR016", "comment": null}, "DXCCSR_CIR017": {"type": "NUMBER", "index": 30, "name": "DXCCSR_CIR017", "comment": null}, "DXCCSR_CIR018": {"type": "NUMBER", "index": 31, "name": "DXCCSR_CIR018", "comment": null}, "DXCCSR_CIR019": {"type": "NUMBER", "index": 32, "name": "DXCCSR_CIR019", "comment": null}, "DXCCSR_CIR020": {"type": "NUMBER", "index": 33, "name": "DXCCSR_CIR020", "comment": null}, "DXCCSR_CIR021": {"type": "NUMBER", "index": 34, "name": "DXCCSR_CIR021", "comment": null}, "DXCCSR_CIR022": {"type": "NUMBER", "index": 35, "name": "DXCCSR_CIR022", "comment": null}, "DXCCSR_CIR023": {"type": "NUMBER", "index": 36, "name": "DXCCSR_CIR023", "comment": null}, "DXCCSR_CIR024": {"type": "NUMBER", "index": 37, "name": "DXCCSR_CIR024", "comment": null}, "DXCCSR_CIR025": {"type": "NUMBER", "index": 38, "name": "DXCCSR_CIR025", "comment": null}, "DXCCSR_CIR026": {"type": "NUMBER", "index": 39, "name": "DXCCSR_CIR026", "comment": null}, "DXCCSR_CIR027": {"type": "NUMBER", "index": 40, "name": "DXCCSR_CIR027", "comment": null}, "DXCCSR_CIR028": {"type": "NUMBER", "index": 41, "name": "DXCCSR_CIR028", "comment": null}, "DXCCSR_CIR029": {"type": "NUMBER", "index": 42, "name": "DXCCSR_CIR029", "comment": null}, "DXCCSR_CIR030": {"type": "NUMBER", "index": 43, "name": "DXCCSR_CIR030", "comment": null}, "DXCCSR_CIR031": {"type": "NUMBER", "index": 44, "name": "DXCCSR_CIR031", "comment": null}, "DXCCSR_CIR032": {"type": "NUMBER", "index": 45, "name": "DXCCSR_CIR032", "comment": null}, "DXCCSR_CIR033": {"type": "NUMBER", "index": 46, "name": "DXCCSR_CIR033", "comment": null}, "DXCCSR_CIR034": {"type": "NUMBER", "index": 47, "name": "DXCCSR_CIR034", "comment": null}, "DXCCSR_CIR035": {"type": "NUMBER", "index": 48, "name": "DXCCSR_CIR035", "comment": null}, "DXCCSR_CIR036": {"type": "NUMBER", "index": 49, "name": "DXCCSR_CIR036", "comment": null}, "DXCCSR_CIR037": {"type": "NUMBER", "index": 50, "name": "DXCCSR_CIR037", "comment": null}, "DXCCSR_CIR038": {"type": "NUMBER", "index": 51, "name": "DXCCSR_CIR038", "comment": null}, "DXCCSR_CIR039": {"type": "NUMBER", "index": 52, "name": "DXCCSR_CIR039", "comment": null}, "DXCCSR_DEN001": {"type": "NUMBER", "index": 53, "name": "DXCCSR_DEN001", "comment": null}, "DXCCSR_DEN002": {"type": "NUMBER", "index": 54, "name": "DXCCSR_DEN002", "comment": null}, "DXCCSR_DEN003": {"type": "NUMBER", "index": 55, "name": "DXCCSR_DEN003", "comment": null}, "DXCCSR_DIG001": {"type": "NUMBER", "index": 56, "name": "DXCCSR_DIG001", "comment": null}, "DXCCSR_DIG002": {"type": "NUMBER", "index": 57, "name": "DXCCSR_DIG002", "comment": null}, "DXCCSR_DIG003": {"type": "NUMBER", "index": 58, "name": "DXCCSR_DIG003", "comment": null}, "DXCCSR_DIG004": {"type": "NUMBER", "index": 59, "name": "DXCCSR_DIG004", "comment": null}, "DXCCSR_DIG005": {"type": "NUMBER", "index": 60, "name": "DXCCSR_DIG005", "comment": null}, "DXCCSR_DIG006": {"type": "NUMBER", "index": 61, "name": "DXCCSR_DIG006", "comment": null}, "DXCCSR_DIG007": {"type": "NUMBER", "index": 62, "name": "DXCCSR_DIG007", "comment": null}, "DXCCSR_DIG008": {"type": "NUMBER", "index": 63, "name": "DXCCSR_DIG008", "comment": null}, "DXCCSR_DIG009": {"type": "NUMBER", "index": 64, "name": "DXCCSR_DIG009", "comment": null}, "DXCCSR_DIG010": {"type": "NUMBER", "index": 65, "name": "DXCCSR_DIG010", "comment": null}, "DXCCSR_DIG011": {"type": "NUMBER", "index": 66, "name": "DXCCSR_DIG011", "comment": null}, "DXCCSR_DIG012": {"type": "NUMBER", "index": 67, "name": "DXCCSR_DIG012", "comment": null}, "DXCCSR_DIG013": {"type": "NUMBER", "index": 68, "name": "DXCCSR_DIG013", "comment": null}, "DXCCSR_DIG014": {"type": "NUMBER", "index": 69, "name": "DXCCSR_DIG014", "comment": null}, "DXCCSR_DIG015": {"type": "NUMBER", "index": 70, "name": "DXCCSR_DIG015", "comment": null}, "DXCCSR_DIG016": {"type": "NUMBER", "index": 71, "name": "DXCCSR_DIG016", "comment": null}, "DXCCSR_DIG017": {"type": "NUMBER", "index": 72, "name": "DXCCSR_DIG017", "comment": null}, "DXCCSR_DIG018": {"type": "NUMBER", "index": 73, "name": "DXCCSR_DIG018", "comment": null}, "DXCCSR_DIG019": {"type": "NUMBER", "index": 74, "name": "DXCCSR_DIG019", "comment": null}, "DXCCSR_DIG020": {"type": "NUMBER", "index": 75, "name": "DXCCSR_DIG020", "comment": null}, "DXCCSR_DIG021": {"type": "NUMBER", "index": 76, "name": "DXCCSR_DIG021", "comment": null}, "DXCCSR_DIG022": {"type": "NUMBER", "index": 77, "name": "DXCCSR_DIG022", "comment": null}, "DXCCSR_DIG023": {"type": "NUMBER", "index": 78, "name": "DXCCSR_DIG023", "comment": null}, "DXCCSR_DIG024": {"type": "NUMBER", "index": 79, "name": "DXCCSR_DIG024", "comment": null}, "DXCCSR_DIG025": {"type": "NUMBER", "index": 80, "name": "DXCCSR_DIG025", "comment": null}, "DXCCSR_EAR001": {"type": "NUMBER", "index": 81, "name": "DXCCSR_EAR001", "comment": null}, "DXCCSR_EAR002": {"type": "NUMBER", "index": 82, "name": "DXCCSR_EAR002", "comment": null}, "DXCCSR_EAR003": {"type": "NUMBER", "index": 83, "name": "DXCCSR_EAR003", "comment": null}, "DXCCSR_EAR004": {"type": "NUMBER", "index": 84, "name": "DXCCSR_EAR004", "comment": null}, "DXCCSR_EAR005": {"type": "NUMBER", "index": 85, "name": "DXCCSR_EAR005", "comment": null}, "DXCCSR_EAR006": {"type": "NUMBER", "index": 86, "name": "DXCCSR_EAR006", "comment": null}, "DXCCSR_END001": {"type": "NUMBER", "index": 87, "name": "DXCCSR_END001", "comment": null}, "DXCCSR_END002": {"type": "NUMBER", "index": 88, "name": "DXCCSR_END002", "comment": null}, "DXCCSR_END003": {"type": "NUMBER", "index": 89, "name": "DXCCSR_END003", "comment": null}, "DXCCSR_END004": {"type": "NUMBER", "index": 90, "name": "DXCCSR_END004", "comment": null}, "DXCCSR_END005": {"type": "NUMBER", "index": 91, "name": "DXCCSR_END005", "comment": null}, "DXCCSR_END006": {"type": "NUMBER", "index": 92, "name": "DXCCSR_END006", "comment": null}, "DXCCSR_END007": {"type": "NUMBER", "index": 93, "name": "DXCCSR_END007", "comment": null}, "DXCCSR_END008": {"type": "NUMBER", "index": 94, "name": "DXCCSR_END008", "comment": null}, "DXCCSR_END009": {"type": "NUMBER", "index": 95, "name": "DXCCSR_END009", "comment": null}, "DXCCSR_END010": {"type": "NUMBER", "index": 96, "name": "DXCCSR_END010", "comment": null}, "DXCCSR_END011": {"type": "NUMBER", "index": 97, "name": "DXCCSR_END011", "comment": null}, "DXCCSR_END012": {"type": "NUMBER", "index": 98, "name": "DXCCSR_END012", "comment": null}, "DXCCSR_END013": {"type": "NUMBER", "index": 99, "name": "DXCCSR_END013", "comment": null}, "DXCCSR_END014": {"type": "NUMBER", "index": 100, "name": "DXCCSR_END014", "comment": null}, "DXCCSR_END015": {"type": "NUMBER", "index": 101, "name": "DXCCSR_END015", "comment": null}, "DXCCSR_END016": {"type": "NUMBER", "index": 102, "name": "DXCCSR_END016", "comment": null}, "DXCCSR_END017": {"type": "NUMBER", "index": 103, "name": "DXCCSR_END017", "comment": null}, "DXCCSR_EXT001": {"type": "NUMBER", "index": 104, "name": "DXCCSR_EXT001", "comment": null}, "DXCCSR_EXT002": {"type": "NUMBER", "index": 105, "name": "DXCCSR_EXT002", "comment": null}, "DXCCSR_EXT003": {"type": "NUMBER", "index": 106, "name": "DXCCSR_EXT003", "comment": null}, "DXCCSR_EXT004": {"type": "NUMBER", "index": 107, "name": "DXCCSR_EXT004", "comment": null}, "DXCCSR_EXT005": {"type": "NUMBER", "index": 108, "name": "DXCCSR_EXT005", "comment": null}, "DXCCSR_EXT006": {"type": "NUMBER", "index": 109, "name": "DXCCSR_EXT006", "comment": null}, "DXCCSR_EXT007": {"type": "NUMBER", "index": 110, "name": "DXCCSR_EXT007", "comment": null}, "DXCCSR_EXT008": {"type": "NUMBER", "index": 111, "name": "DXCCSR_EXT008", "comment": null}, "DXCCSR_EXT009": {"type": "NUMBER", "index": 112, "name": "DXCCSR_EXT009", "comment": null}, "DXCCSR_EXT010": {"type": "NUMBER", "index": 113, "name": "DXCCSR_EXT010", "comment": null}, "DXCCSR_EXT011": {"type": "NUMBER", "index": 114, "name": "DXCCSR_EXT011", "comment": null}, "DXCCSR_EXT012": {"type": "NUMBER", "index": 115, "name": "DXCCSR_EXT012", "comment": null}, "DXCCSR_EXT013": {"type": "NUMBER", "index": 116, "name": "DXCCSR_EXT013", "comment": null}, "DXCCSR_EXT014": {"type": "NUMBER", "index": 117, "name": "DXCCSR_EXT014", "comment": null}, "DXCCSR_EXT015": {"type": "NUMBER", "index": 118, "name": "DXCCSR_EXT015", "comment": null}, "DXCCSR_EXT016": {"type": "NUMBER", "index": 119, "name": "DXCCSR_EXT016", "comment": null}, "DXCCSR_EXT017": {"type": "NUMBER", "index": 120, "name": "DXCCSR_EXT017", "comment": null}, "DXCCSR_EXT018": {"type": "NUMBER", "index": 121, "name": "DXCCSR_EXT018", "comment": null}, "DXCCSR_EXT019": {"type": "NUMBER", "index": 122, "name": "DXCCSR_EXT019", "comment": null}, "DXCCSR_EXT020": {"type": "NUMBER", "index": 123, "name": "DXCCSR_EXT020", "comment": null}, "DXCCSR_EXT021": {"type": "NUMBER", "index": 124, "name": "DXCCSR_EXT021", "comment": null}, "DXCCSR_EXT022": {"type": "NUMBER", "index": 125, "name": "DXCCSR_EXT022", "comment": null}, "DXCCSR_EXT023": {"type": "NUMBER", "index": 126, "name": "DXCCSR_EXT023", "comment": null}, "DXCCSR_EXT024": {"type": "NUMBER", "index": 127, "name": "DXCCSR_EXT024", "comment": null}, "DXCCSR_EXT025": {"type": "NUMBER", "index": 128, "name": "DXCCSR_EXT025", "comment": null}, "DXCCSR_EXT026": {"type": "NUMBER", "index": 129, "name": "DXCCSR_EXT026", "comment": null}, "DXCCSR_EXT027": {"type": "NUMBER", "index": 130, "name": "DXCCSR_EXT027", "comment": null}, "DXCCSR_EXT028": {"type": "NUMBER", "index": 131, "name": "DXCCSR_EXT028", "comment": null}, "DXCCSR_EXT029": {"type": "NUMBER", "index": 132, "name": "DXCCSR_EXT029", "comment": null}, "DXCCSR_EXT030": {"type": "NUMBER", "index": 133, "name": "DXCCSR_EXT030", "comment": null}, "DXCCSR_EYE001": {"type": "NUMBER", "index": 134, "name": "DXCCSR_EYE001", "comment": null}, "DXCCSR_EYE002": {"type": "NUMBER", "index": 135, "name": "DXCCSR_EYE002", "comment": null}, "DXCCSR_EYE003": {"type": "NUMBER", "index": 136, "name": "DXCCSR_EYE003", "comment": null}, "DXCCSR_EYE004": {"type": "NUMBER", "index": 137, "name": "DXCCSR_EYE004", "comment": null}, "DXCCSR_EYE005": {"type": "NUMBER", "index": 138, "name": "DXCCSR_EYE005", "comment": null}, "DXCCSR_EYE006": {"type": "NUMBER", "index": 139, "name": "DXCCSR_EYE006", "comment": null}, "DXCCSR_EYE007": {"type": "NUMBER", "index": 140, "name": "DXCCSR_EYE007", "comment": null}, "DXCCSR_EYE008": {"type": "NUMBER", "index": 141, "name": "DXCCSR_EYE008", "comment": null}, "DXCCSR_EYE009": {"type": "NUMBER", "index": 142, "name": "DXCCSR_EYE009", "comment": null}, "DXCCSR_EYE010": {"type": "NUMBER", "index": 143, "name": "DXCCSR_EYE010", "comment": null}, "DXCCSR_EYE011": {"type": "NUMBER", "index": 144, "name": "DXCCSR_EYE011", "comment": null}, "DXCCSR_EYE012": {"type": "NUMBER", "index": 145, "name": "DXCCSR_EYE012", "comment": null}, "DXCCSR_FAC001": {"type": "NUMBER", "index": 146, "name": "DXCCSR_FAC001", "comment": null}, "DXCCSR_FAC002": {"type": "NUMBER", "index": 147, "name": "DXCCSR_FAC002", "comment": null}, "DXCCSR_FAC003": {"type": "NUMBER", "index": 148, "name": "DXCCSR_FAC003", "comment": null}, "DXCCSR_FAC004": {"type": "NUMBER", "index": 149, "name": "DXCCSR_FAC004", "comment": null}, "DXCCSR_FAC005": {"type": "NUMBER", "index": 150, "name": "DXCCSR_FAC005", "comment": null}, "DXCCSR_FAC006": {"type": "NUMBER", "index": 151, "name": "DXCCSR_FAC006", "comment": null}, "DXCCSR_FAC007": {"type": "NUMBER", "index": 152, "name": "DXCCSR_FAC007", "comment": null}, "DXCCSR_FAC008": {"type": "NUMBER", "index": 153, "name": "DXCCSR_FAC008", "comment": null}, "DXCCSR_FAC009": {"type": "NUMBER", "index": 154, "name": "DXCCSR_FAC009", "comment": null}, "DXCCSR_FAC010": {"type": "NUMBER", "index": 155, "name": "DXCCSR_FAC010", "comment": null}, "DXCCSR_FAC011": {"type": "NUMBER", "index": 156, "name": "DXCCSR_FAC011", "comment": null}, "DXCCSR_FAC012": {"type": "NUMBER", "index": 157, "name": "DXCCSR_FAC012", "comment": null}, "DXCCSR_FAC013": {"type": "NUMBER", "index": 158, "name": "DXCCSR_FAC013", "comment": null}, "DXCCSR_FAC014": {"type": "NUMBER", "index": 159, "name": "DXCCSR_FAC014", "comment": null}, "DXCCSR_FAC015": {"type": "NUMBER", "index": 160, "name": "DXCCSR_FAC015", "comment": null}, "DXCCSR_FAC016": {"type": "NUMBER", "index": 161, "name": "DXCCSR_FAC016", "comment": null}, "DXCCSR_FAC017": {"type": "NUMBER", "index": 162, "name": "DXCCSR_FAC017", "comment": null}, "DXCCSR_FAC018": {"type": "NUMBER", "index": 163, "name": "DXCCSR_FAC018", "comment": null}, "DXCCSR_FAC019": {"type": "NUMBER", "index": 164, "name": "DXCCSR_FAC019", "comment": null}, "DXCCSR_FAC020": {"type": "NUMBER", "index": 165, "name": "DXCCSR_FAC020", "comment": null}, "DXCCSR_FAC021": {"type": "NUMBER", "index": 166, "name": "DXCCSR_FAC021", "comment": null}, "DXCCSR_FAC022": {"type": "NUMBER", "index": 167, "name": "DXCCSR_FAC022", "comment": null}, "DXCCSR_FAC023": {"type": "NUMBER", "index": 168, "name": "DXCCSR_FAC023", "comment": null}, "DXCCSR_FAC024": {"type": "NUMBER", "index": 169, "name": "DXCCSR_FAC024", "comment": null}, "DXCCSR_FAC025": {"type": "NUMBER", "index": 170, "name": "DXCCSR_FAC025", "comment": null}, "DXCCSR_GEN001": {"type": "NUMBER", "index": 171, "name": "DXCCSR_GEN001", "comment": null}, "DXCCSR_GEN002": {"type": "NUMBER", "index": 172, "name": "DXCCSR_GEN002", "comment": null}, "DXCCSR_GEN003": {"type": "NUMBER", "index": 173, "name": "DXCCSR_GEN003", "comment": null}, "DXCCSR_GEN004": {"type": "NUMBER", "index": 174, "name": "DXCCSR_GEN004", "comment": null}, "DXCCSR_GEN005": {"type": "NUMBER", "index": 175, "name": "DXCCSR_GEN005", "comment": null}, "DXCCSR_GEN006": {"type": "NUMBER", "index": 176, "name": "DXCCSR_GEN006", "comment": null}, "DXCCSR_GEN007": {"type": "NUMBER", "index": 177, "name": "DXCCSR_GEN007", "comment": null}, "DXCCSR_GEN008": {"type": "NUMBER", "index": 178, "name": "DXCCSR_GEN008", "comment": null}, "DXCCSR_GEN009": {"type": "NUMBER", "index": 179, "name": "DXCCSR_GEN009", "comment": null}, "DXCCSR_GEN010": {"type": "NUMBER", "index": 180, "name": "DXCCSR_GEN010", "comment": null}, "DXCCSR_GEN011": {"type": "NUMBER", "index": 181, "name": "DXCCSR_GEN011", "comment": null}, "DXCCSR_GEN012": {"type": "NUMBER", "index": 182, "name": "DXCCSR_GEN012", "comment": null}, "DXCCSR_GEN013": {"type": "NUMBER", "index": 183, "name": "DXCCSR_GEN013", "comment": null}, "DXCCSR_GEN014": {"type": "NUMBER", "index": 184, "name": "DXCCSR_GEN014", "comment": null}, "DXCCSR_GEN015": {"type": "NUMBER", "index": 185, "name": "DXCCSR_GEN015", "comment": null}, "DXCCSR_GEN016": {"type": "NUMBER", "index": 186, "name": "DXCCSR_GEN016", "comment": null}, "DXCCSR_GEN017": {"type": "NUMBER", "index": 187, "name": "DXCCSR_GEN017", "comment": null}, "DXCCSR_GEN018": {"type": "NUMBER", "index": 188, "name": "DXCCSR_GEN018", "comment": null}, "DXCCSR_GEN019": {"type": "NUMBER", "index": 189, "name": "DXCCSR_GEN019", "comment": null}, "DXCCSR_GEN020": {"type": "NUMBER", "index": 190, "name": "DXCCSR_GEN020", "comment": null}, "DXCCSR_GEN021": {"type": "NUMBER", "index": 191, "name": "DXCCSR_GEN021", "comment": null}, "DXCCSR_GEN022": {"type": "NUMBER", "index": 192, "name": "DXCCSR_GEN022", "comment": null}, "DXCCSR_GEN023": {"type": "NUMBER", "index": 193, "name": "DXCCSR_GEN023", "comment": null}, "DXCCSR_GEN024": {"type": "NUMBER", "index": 194, "name": "DXCCSR_GEN024", "comment": null}, "DXCCSR_GEN025": {"type": "NUMBER", "index": 195, "name": "DXCCSR_GEN025", "comment": null}, "DXCCSR_GEN026": {"type": "NUMBER", "index": 196, "name": "DXCCSR_GEN026", "comment": null}, "DXCCSR_INF001": {"type": "NUMBER", "index": 197, "name": "DXCCSR_INF001", "comment": null}, "DXCCSR_INF002": {"type": "NUMBER", "index": 198, "name": "DXCCSR_INF002", "comment": null}, "DXCCSR_INF003": {"type": "NUMBER", "index": 199, "name": "DXCCSR_INF003", "comment": null}, "DXCCSR_INF004": {"type": "NUMBER", "index": 200, "name": "DXCCSR_INF004", "comment": null}, "DXCCSR_INF005": {"type": "NUMBER", "index": 201, "name": "DXCCSR_INF005", "comment": null}, "DXCCSR_INF006": {"type": "NUMBER", "index": 202, "name": "DXCCSR_INF006", "comment": null}, "DXCCSR_INF007": {"type": "NUMBER", "index": 203, "name": "DXCCSR_INF007", "comment": null}, "DXCCSR_INF008": {"type": "NUMBER", "index": 204, "name": "DXCCSR_INF008", "comment": null}, "DXCCSR_INF009": {"type": "NUMBER", "index": 205, "name": "DXCCSR_INF009", "comment": null}, "DXCCSR_INF010": {"type": "NUMBER", "index": 206, "name": "DXCCSR_INF010", "comment": null}, "DXCCSR_INF011": {"type": "NUMBER", "index": 207, "name": "DXCCSR_INF011", "comment": null}, "DXCCSR_INF012": {"type": "NUMBER", "index": 208, "name": "DXCCSR_INF012", "comment": null}, "DXCCSR_INJ001": {"type": "NUMBER", "index": 209, "name": "DXCCSR_INJ001", "comment": null}, "DXCCSR_INJ002": {"type": "NUMBER", "index": 210, "name": "DXCCSR_INJ002", "comment": null}, "DXCCSR_INJ003": {"type": "NUMBER", "index": 211, "name": "DXCCSR_INJ003", "comment": null}, "DXCCSR_INJ004": {"type": "NUMBER", "index": 212, "name": "DXCCSR_INJ004", "comment": null}, "DXCCSR_INJ005": {"type": "NUMBER", "index": 213, "name": "DXCCSR_INJ005", "comment": null}, "DXCCSR_INJ006": {"type": "NUMBER", "index": 214, "name": "DXCCSR_INJ006", "comment": null}, "DXCCSR_INJ007": {"type": "NUMBER", "index": 215, "name": "DXCCSR_INJ007", "comment": null}, "DXCCSR_INJ008": {"type": "NUMBER", "index": 216, "name": "DXCCSR_INJ008", "comment": null}, "DXCCSR_INJ009": {"type": "NUMBER", "index": 217, "name": "DXCCSR_INJ009", "comment": null}, "DXCCSR_INJ010": {"type": "NUMBER", "index": 218, "name": "DXCCSR_INJ010", "comment": null}, "DXCCSR_INJ011": {"type": "NUMBER", "index": 219, "name": "DXCCSR_INJ011", "comment": null}, "DXCCSR_INJ012": {"type": "NUMBER", "index": 220, "name": "DXCCSR_INJ012", "comment": null}, "DXCCSR_INJ013": {"type": "NUMBER", "index": 221, "name": "DXCCSR_INJ013", "comment": null}, "DXCCSR_INJ014": {"type": "NUMBER", "index": 222, "name": "DXCCSR_INJ014", "comment": null}, "DXCCSR_INJ015": {"type": "NUMBER", "index": 223, "name": "DXCCSR_INJ015", "comment": null}, "DXCCSR_INJ016": {"type": "NUMBER", "index": 224, "name": "DXCCSR_INJ016", "comment": null}, "DXCCSR_INJ017": {"type": "NUMBER", "index": 225, "name": "DXCCSR_INJ017", "comment": null}, "DXCCSR_INJ018": {"type": "NUMBER", "index": 226, "name": "DXCCSR_INJ018", "comment": null}, "DXCCSR_INJ019": {"type": "NUMBER", "index": 227, "name": "DXCCSR_INJ019", "comment": null}, "DXCCSR_INJ020": {"type": "NUMBER", "index": 228, "name": "DXCCSR_INJ020", "comment": null}, "DXCCSR_INJ021": {"type": "NUMBER", "index": 229, "name": "DXCCSR_INJ021", "comment": null}, "DXCCSR_INJ022": {"type": "NUMBER", "index": 230, "name": "DXCCSR_INJ022", "comment": null}, "DXCCSR_INJ023": {"type": "NUMBER", "index": 231, "name": "DXCCSR_INJ023", "comment": null}, "DXCCSR_INJ024": {"type": "NUMBER", "index": 232, "name": "DXCCSR_INJ024", "comment": null}, "DXCCSR_INJ025": {"type": "NUMBER", "index": 233, "name": "DXCCSR_INJ025", "comment": null}, "DXCCSR_INJ026": {"type": "NUMBER", "index": 234, "name": "DXCCSR_INJ026", "comment": null}, "DXCCSR_INJ027": {"type": "NUMBER", "index": 235, "name": "DXCCSR_INJ027", "comment": null}, "DXCCSR_INJ028": {"type": "NUMBER", "index": 236, "name": "DXCCSR_INJ028", "comment": null}, "DXCCSR_INJ029": {"type": "NUMBER", "index": 237, "name": "DXCCSR_INJ029", "comment": null}, "DXCCSR_INJ030": {"type": "NUMBER", "index": 238, "name": "DXCCSR_INJ030", "comment": null}, "DXCCSR_INJ031": {"type": "NUMBER", "index": 239, "name": "DXCCSR_INJ031", "comment": null}, "DXCCSR_INJ032": {"type": "NUMBER", "index": 240, "name": "DXCCSR_INJ032", "comment": null}, "DXCCSR_INJ033": {"type": "NUMBER", "index": 241, "name": "DXCCSR_INJ033", "comment": null}, "DXCCSR_INJ034": {"type": "NUMBER", "index": 242, "name": "DXCCSR_INJ034", "comment": null}, "DXCCSR_INJ035": {"type": "NUMBER", "index": 243, "name": "DXCCSR_INJ035", "comment": null}, "DXCCSR_INJ036": {"type": "NUMBER", "index": 244, "name": "DXCCSR_INJ036", "comment": null}, "DXCCSR_INJ037": {"type": "NUMBER", "index": 245, "name": "DXCCSR_INJ037", "comment": null}, "DXCCSR_INJ038": {"type": "NUMBER", "index": 246, "name": "DXCCSR_INJ038", "comment": null}, "DXCCSR_INJ039": {"type": "NUMBER", "index": 247, "name": "DXCCSR_INJ039", "comment": null}, "DXCCSR_INJ040": {"type": "NUMBER", "index": 248, "name": "DXCCSR_INJ040", "comment": null}, "DXCCSR_INJ041": {"type": "NUMBER", "index": 249, "name": "DXCCSR_INJ041", "comment": null}, "DXCCSR_INJ042": {"type": "NUMBER", "index": 250, "name": "DXCCSR_INJ042", "comment": null}, "DXCCSR_INJ043": {"type": "NUMBER", "index": 251, "name": "DXCCSR_INJ043", "comment": null}, "DXCCSR_INJ044": {"type": "NUMBER", "index": 252, "name": "DXCCSR_INJ044", "comment": null}, "DXCCSR_INJ045": {"type": "NUMBER", "index": 253, "name": "DXCCSR_INJ045", "comment": null}, "DXCCSR_INJ046": {"type": "NUMBER", "index": 254, "name": "DXCCSR_INJ046", "comment": null}, "DXCCSR_INJ047": {"type": "NUMBER", "index": 255, "name": "DXCCSR_INJ047", "comment": null}, "DXCCSR_INJ048": {"type": "NUMBER", "index": 256, "name": "DXCCSR_INJ048", "comment": null}, "DXCCSR_INJ049": {"type": "NUMBER", "index": 257, "name": "DXCCSR_INJ049", "comment": null}, "DXCCSR_INJ050": {"type": "NUMBER", "index": 258, "name": "DXCCSR_INJ050", "comment": null}, "DXCCSR_INJ051": {"type": "NUMBER", "index": 259, "name": "DXCCSR_INJ051", "comment": null}, "DXCCSR_INJ052": {"type": "NUMBER", "index": 260, "name": "DXCCSR_INJ052", "comment": null}, "DXCCSR_INJ053": {"type": "NUMBER", "index": 261, "name": "DXCCSR_INJ053", "comment": null}, "DXCCSR_INJ054": {"type": "NUMBER", "index": 262, "name": "DXCCSR_INJ054", "comment": null}, "DXCCSR_INJ055": {"type": "NUMBER", "index": 263, "name": "DXCCSR_INJ055", "comment": null}, "DXCCSR_INJ056": {"type": "NUMBER", "index": 264, "name": "DXCCSR_INJ056", "comment": null}, "DXCCSR_INJ057": {"type": "NUMBER", "index": 265, "name": "DXCCSR_INJ057", "comment": null}, "DXCCSR_INJ058": {"type": "NUMBER", "index": 266, "name": "DXCCSR_INJ058", "comment": null}, "DXCCSR_INJ059": {"type": "NUMBER", "index": 267, "name": "DXCCSR_INJ059", "comment": null}, "DXCCSR_INJ060": {"type": "NUMBER", "index": 268, "name": "DXCCSR_INJ060", "comment": null}, "DXCCSR_INJ061": {"type": "NUMBER", "index": 269, "name": "DXCCSR_INJ061", "comment": null}, "DXCCSR_INJ062": {"type": "NUMBER", "index": 270, "name": "DXCCSR_INJ062", "comment": null}, "DXCCSR_INJ063": {"type": "NUMBER", "index": 271, "name": "DXCCSR_INJ063", "comment": null}, "DXCCSR_INJ064": {"type": "NUMBER", "index": 272, "name": "DXCCSR_INJ064", "comment": null}, "DXCCSR_INJ065": {"type": "NUMBER", "index": 273, "name": "DXCCSR_INJ065", "comment": null}, "DXCCSR_INJ066": {"type": "NUMBER", "index": 274, "name": "DXCCSR_INJ066", "comment": null}, "DXCCSR_INJ067": {"type": "NUMBER", "index": 275, "name": "DXCCSR_INJ067", "comment": null}, "DXCCSR_INJ068": {"type": "NUMBER", "index": 276, "name": "DXCCSR_INJ068", "comment": null}, "DXCCSR_INJ069": {"type": "NUMBER", "index": 277, "name": "DXCCSR_INJ069", "comment": null}, "DXCCSR_INJ070": {"type": "NUMBER", "index": 278, "name": "DXCCSR_INJ070", "comment": null}, "DXCCSR_INJ071": {"type": "NUMBER", "index": 279, "name": "DXCCSR_INJ071", "comment": null}, "DXCCSR_INJ072": {"type": "NUMBER", "index": 280, "name": "DXCCSR_INJ072", "comment": null}, "DXCCSR_INJ073": {"type": "NUMBER", "index": 281, "name": "DXCCSR_INJ073", "comment": null}, "DXCCSR_INJ074": {"type": "NUMBER", "index": 282, "name": "DXCCSR_INJ074", "comment": null}, "DXCCSR_INJ075": {"type": "NUMBER", "index": 283, "name": "DXCCSR_INJ075", "comment": null}, "DXCCSR_INJ076": {"type": "NUMBER", "index": 284, "name": "DXCCSR_INJ076", "comment": null}, "DXCCSR_MAL001": {"type": "NUMBER", "index": 285, "name": "DXCCSR_MAL001", "comment": null}, "DXCCSR_MAL002": {"type": "NUMBER", "index": 286, "name": "DXCCSR_MAL002", "comment": null}, "DXCCSR_MAL003": {"type": "NUMBER", "index": 287, "name": "DXCCSR_MAL003", "comment": null}, "DXCCSR_MAL004": {"type": "NUMBER", "index": 288, "name": "DXCCSR_MAL004", "comment": null}, "DXCCSR_MAL005": {"type": "NUMBER", "index": 289, "name": "DXCCSR_MAL005", "comment": null}, "DXCCSR_MAL006": {"type": "NUMBER", "index": 290, "name": "DXCCSR_MAL006", "comment": null}, "DXCCSR_MAL007": {"type": "NUMBER", "index": 291, "name": "DXCCSR_MAL007", "comment": null}, "DXCCSR_MAL008": {"type": "NUMBER", "index": 292, "name": "DXCCSR_MAL008", "comment": null}, "DXCCSR_MAL009": {"type": "NUMBER", "index": 293, "name": "DXCCSR_MAL009", "comment": null}, "DXCCSR_MAL010": {"type": "NUMBER", "index": 294, "name": "DXCCSR_MAL010", "comment": null}, "DXCCSR_MBD001": {"type": "NUMBER", "index": 295, "name": "DXCCSR_MBD001", "comment": null}, "DXCCSR_MBD002": {"type": "NUMBER", "index": 296, "name": "DXCCSR_MBD002", "comment": null}, "DXCCSR_MBD003": {"type": "NUMBER", "index": 297, "name": "DXCCSR_MBD003", "comment": null}, "DXCCSR_MBD004": {"type": "NUMBER", "index": 298, "name": "DXCCSR_MBD004", "comment": null}, "DXCCSR_MBD005": {"type": "NUMBER", "index": 299, "name": "DXCCSR_MBD005", "comment": null}, "DXCCSR_MBD006": {"type": "NUMBER", "index": 300, "name": "DXCCSR_MBD006", "comment": null}, "DXCCSR_MBD007": {"type": "NUMBER", "index": 301, "name": "DXCCSR_MBD007", "comment": null}, "DXCCSR_MBD008": {"type": "NUMBER", "index": 302, "name": "DXCCSR_MBD008", "comment": null}, "DXCCSR_MBD009": {"type": "NUMBER", "index": 303, "name": "DXCCSR_MBD009", "comment": null}, "DXCCSR_MBD010": {"type": "NUMBER", "index": 304, "name": "DXCCSR_MBD010", "comment": null}, "DXCCSR_MBD011": {"type": "NUMBER", "index": 305, "name": "DXCCSR_MBD011", "comment": null}, "DXCCSR_MBD012": {"type": "NUMBER", "index": 306, "name": "DXCCSR_MBD012", "comment": null}, "DXCCSR_MBD013": {"type": "NUMBER", "index": 307, "name": "DXCCSR_MBD013", "comment": null}, "DXCCSR_MBD014": {"type": "NUMBER", "index": 308, "name": "DXCCSR_MBD014", "comment": null}, "DXCCSR_MBD017": {"type": "NUMBER", "index": 309, "name": "DXCCSR_MBD017", "comment": null}, "DXCCSR_MBD018": {"type": "NUMBER", "index": 310, "name": "DXCCSR_MBD018", "comment": null}, "DXCCSR_MBD019": {"type": "NUMBER", "index": 311, "name": "DXCCSR_MBD019", "comment": null}, "DXCCSR_MBD020": {"type": "NUMBER", "index": 312, "name": "DXCCSR_MBD020", "comment": null}, "DXCCSR_MBD021": {"type": "NUMBER", "index": 313, "name": "DXCCSR_MBD021", "comment": null}, "DXCCSR_MBD022": {"type": "NUMBER", "index": 314, "name": "DXCCSR_MBD022", "comment": null}, "DXCCSR_MBD023": {"type": "NUMBER", "index": 315, "name": "DXCCSR_MBD023", "comment": null}, "DXCCSR_MBD024": {"type": "NUMBER", "index": 316, "name": "DXCCSR_MBD024", "comment": null}, "DXCCSR_MBD025": {"type": "NUMBER", "index": 317, "name": "DXCCSR_MBD025", "comment": null}, "DXCCSR_MBD026": {"type": "NUMBER", "index": 318, "name": "DXCCSR_MBD026", "comment": null}, "DXCCSR_MBD027": {"type": "NUMBER", "index": 319, "name": "DXCCSR_MBD027", "comment": null}, "DXCCSR_MBD028": {"type": "NUMBER", "index": 320, "name": "DXCCSR_MBD028", "comment": null}, "DXCCSR_MBD029": {"type": "NUMBER", "index": 321, "name": "DXCCSR_MBD029", "comment": null}, "DXCCSR_MBD030": {"type": "NUMBER", "index": 322, "name": "DXCCSR_MBD030", "comment": null}, "DXCCSR_MBD031": {"type": "NUMBER", "index": 323, "name": "DXCCSR_MBD031", "comment": null}, "DXCCSR_MBD032": {"type": "NUMBER", "index": 324, "name": "DXCCSR_MBD032", "comment": null}, "DXCCSR_MBD033": {"type": "NUMBER", "index": 325, "name": "DXCCSR_MBD033", "comment": null}, "DXCCSR_MBD034": {"type": "NUMBER", "index": 326, "name": "DXCCSR_MBD034", "comment": null}, "DXCCSR_MUS001": {"type": "NUMBER", "index": 327, "name": "DXCCSR_MUS001", "comment": null}, "DXCCSR_MUS002": {"type": "NUMBER", "index": 328, "name": "DXCCSR_MUS002", "comment": null}, "DXCCSR_MUS003": {"type": "NUMBER", "index": 329, "name": "DXCCSR_MUS003", "comment": null}, "DXCCSR_MUS004": {"type": "NUMBER", "index": 330, "name": "DXCCSR_MUS004", "comment": null}, "DXCCSR_MUS005": {"type": "NUMBER", "index": 331, "name": "DXCCSR_MUS005", "comment": null}, "DXCCSR_MUS006": {"type": "NUMBER", "index": 332, "name": "DXCCSR_MUS006", "comment": null}, "DXCCSR_MUS007": {"type": "NUMBER", "index": 333, "name": "DXCCSR_MUS007", "comment": null}, "DXCCSR_MUS008": {"type": "NUMBER", "index": 334, "name": "DXCCSR_MUS008", "comment": null}, "DXCCSR_MUS009": {"type": "NUMBER", "index": 335, "name": "DXCCSR_MUS009", "comment": null}, "DXCCSR_MUS010": {"type": "NUMBER", "index": 336, "name": "DXCCSR_MUS010", "comment": null}, "DXCCSR_MUS011": {"type": "NUMBER", "index": 337, "name": "DXCCSR_MUS011", "comment": null}, "DXCCSR_MUS012": {"type": "NUMBER", "index": 338, "name": "DXCCSR_MUS012", "comment": null}, "DXCCSR_MUS013": {"type": "NUMBER", "index": 339, "name": "DXCCSR_MUS013", "comment": null}, "DXCCSR_MUS014": {"type": "NUMBER", "index": 340, "name": "DXCCSR_MUS014", "comment": null}, "DXCCSR_MUS015": {"type": "NUMBER", "index": 341, "name": "DXCCSR_MUS015", "comment": null}, "DXCCSR_MUS016": {"type": "NUMBER", "index": 342, "name": "DXCCSR_MUS016", "comment": null}, "DXCCSR_MUS017": {"type": "NUMBER", "index": 343, "name": "DXCCSR_MUS017", "comment": null}, "DXCCSR_MUS018": {"type": "NUMBER", "index": 344, "name": "DXCCSR_MUS018", "comment": null}, "DXCCSR_MUS019": {"type": "NUMBER", "index": 345, "name": "DXCCSR_MUS019", "comment": null}, "DXCCSR_MUS020": {"type": "NUMBER", "index": 346, "name": "DXCCSR_MUS020", "comment": null}, "DXCCSR_MUS021": {"type": "NUMBER", "index": 347, "name": "DXCCSR_MUS021", "comment": null}, "DXCCSR_MUS022": {"type": "NUMBER", "index": 348, "name": "DXCCSR_MUS022", "comment": null}, "DXCCSR_MUS023": {"type": "NUMBER", "index": 349, "name": "DXCCSR_MUS023", "comment": null}, "DXCCSR_MUS024": {"type": "NUMBER", "index": 350, "name": "DXCCSR_MUS024", "comment": null}, "DXCCSR_MUS025": {"type": "NUMBER", "index": 351, "name": "DXCCSR_MUS025", "comment": null}, "DXCCSR_MUS026": {"type": "NUMBER", "index": 352, "name": "DXCCSR_MUS026", "comment": null}, "DXCCSR_MUS027": {"type": "NUMBER", "index": 353, "name": "DXCCSR_MUS027", "comment": null}, "DXCCSR_MUS028": {"type": "NUMBER", "index": 354, "name": "DXCCSR_MUS028", "comment": null}, "DXCCSR_MUS029": {"type": "NUMBER", "index": 355, "name": "DXCCSR_MUS029", "comment": null}, "DXCCSR_MUS030": {"type": "NUMBER", "index": 356, "name": "DXCCSR_MUS030", "comment": null}, "DXCCSR_MUS031": {"type": "NUMBER", "index": 357, "name": "DXCCSR_MUS031", "comment": null}, "DXCCSR_MUS032": {"type": "NUMBER", "index": 358, "name": "DXCCSR_MUS032", "comment": null}, "DXCCSR_MUS033": {"type": "NUMBER", "index": 359, "name": "DXCCSR_MUS033", "comment": null}, "DXCCSR_MUS034": {"type": "NUMBER", "index": 360, "name": "DXCCSR_MUS034", "comment": null}, "DXCCSR_MUS035": {"type": "NUMBER", "index": 361, "name": "DXCCSR_MUS035", "comment": null}, "DXCCSR_MUS036": {"type": "NUMBER", "index": 362, "name": "DXCCSR_MUS036", "comment": null}, "DXCCSR_MUS037": {"type": "NUMBER", "index": 363, "name": "DXCCSR_MUS037", "comment": null}, "DXCCSR_MUS038": {"type": "NUMBER", "index": 364, "name": "DXCCSR_MUS038", "comment": null}, "DXCCSR_NEO001": {"type": "NUMBER", "index": 365, "name": "DXCCSR_NEO001", "comment": null}, "DXCCSR_NEO002": {"type": "NUMBER", "index": 366, "name": "DXCCSR_NEO002", "comment": null}, "DXCCSR_NEO003": {"type": "NUMBER", "index": 367, "name": "DXCCSR_NEO003", "comment": null}, "DXCCSR_NEO004": {"type": "NUMBER", "index": 368, "name": "DXCCSR_NEO004", "comment": null}, "DXCCSR_NEO005": {"type": "NUMBER", "index": 369, "name": "DXCCSR_NEO005", "comment": null}, "DXCCSR_NEO006": {"type": "NUMBER", "index": 370, "name": "DXCCSR_NEO006", "comment": null}, "DXCCSR_NEO007": {"type": "NUMBER", "index": 371, "name": "DXCCSR_NEO007", "comment": null}, "DXCCSR_NEO008": {"type": "NUMBER", "index": 372, "name": "DXCCSR_NEO008", "comment": null}, "DXCCSR_NEO009": {"type": "NUMBER", "index": 373, "name": "DXCCSR_NEO009", "comment": null}, "DXCCSR_NEO010": {"type": "NUMBER", "index": 374, "name": "DXCCSR_NEO010", "comment": null}, "DXCCSR_NEO011": {"type": "NUMBER", "index": 375, "name": "DXCCSR_NEO011", "comment": null}, "DXCCSR_NEO012": {"type": "NUMBER", "index": 376, "name": "DXCCSR_NEO012", "comment": null}, "DXCCSR_NEO013": {"type": "NUMBER", "index": 377, "name": "DXCCSR_NEO013", "comment": null}, "DXCCSR_NEO014": {"type": "NUMBER", "index": 378, "name": "DXCCSR_NEO014", "comment": null}, "DXCCSR_NEO015": {"type": "NUMBER", "index": 379, "name": "DXCCSR_NEO015", "comment": null}, "DXCCSR_NEO016": {"type": "NUMBER", "index": 380, "name": "DXCCSR_NEO016", "comment": null}, "DXCCSR_NEO017": {"type": "NUMBER", "index": 381, "name": "DXCCSR_NEO017", "comment": null}, "DXCCSR_NEO018": {"type": "NUMBER", "index": 382, "name": "DXCCSR_NEO018", "comment": null}, "DXCCSR_NEO019": {"type": "NUMBER", "index": 383, "name": "DXCCSR_NEO019", "comment": null}, "DXCCSR_NEO020": {"type": "NUMBER", "index": 384, "name": "DXCCSR_NEO020", "comment": null}, "DXCCSR_NEO021": {"type": "NUMBER", "index": 385, "name": "DXCCSR_NEO021", "comment": null}, "DXCCSR_NEO022": {"type": "NUMBER", "index": 386, "name": "DXCCSR_NEO022", "comment": null}, "DXCCSR_NEO023": {"type": "NUMBER", "index": 387, "name": "DXCCSR_NEO023", "comment": null}, "DXCCSR_NEO024": {"type": "NUMBER", "index": 388, "name": "DXCCSR_NEO024", "comment": null}, "DXCCSR_NEO025": {"type": "NUMBER", "index": 389, "name": "DXCCSR_NEO025", "comment": null}, "DXCCSR_NEO026": {"type": "NUMBER", "index": 390, "name": "DXCCSR_NEO026", "comment": null}, "DXCCSR_NEO027": {"type": "NUMBER", "index": 391, "name": "DXCCSR_NEO027", "comment": null}, "DXCCSR_NEO028": {"type": "NUMBER", "index": 392, "name": "DXCCSR_NEO028", "comment": null}, "DXCCSR_NEO029": {"type": "NUMBER", "index": 393, "name": "DXCCSR_NEO029", "comment": null}, "DXCCSR_NEO030": {"type": "NUMBER", "index": 394, "name": "DXCCSR_NEO030", "comment": null}, "DXCCSR_NEO031": {"type": "NUMBER", "index": 395, "name": "DXCCSR_NEO031", "comment": null}, "DXCCSR_NEO032": {"type": "NUMBER", "index": 396, "name": "DXCCSR_NEO032", "comment": null}, "DXCCSR_NEO033": {"type": "NUMBER", "index": 397, "name": "DXCCSR_NEO033", "comment": null}, "DXCCSR_NEO034": {"type": "NUMBER", "index": 398, "name": "DXCCSR_NEO034", "comment": null}, "DXCCSR_NEO035": {"type": "NUMBER", "index": 399, "name": "DXCCSR_NEO035", "comment": null}, "DXCCSR_NEO036": {"type": "NUMBER", "index": 400, "name": "DXCCSR_NEO036", "comment": null}, "DXCCSR_NEO037": {"type": "NUMBER", "index": 401, "name": "DXCCSR_NEO037", "comment": null}, "DXCCSR_NEO038": {"type": "NUMBER", "index": 402, "name": "DXCCSR_NEO038", "comment": null}, "DXCCSR_NEO039": {"type": "NUMBER", "index": 403, "name": "DXCCSR_NEO039", "comment": null}, "DXCCSR_NEO040": {"type": "NUMBER", "index": 404, "name": "DXCCSR_NEO040", "comment": null}, "DXCCSR_NEO041": {"type": "NUMBER", "index": 405, "name": "DXCCSR_NEO041", "comment": null}, "DXCCSR_NEO042": {"type": "NUMBER", "index": 406, "name": "DXCCSR_NEO042", "comment": null}, "DXCCSR_NEO043": {"type": "NUMBER", "index": 407, "name": "DXCCSR_NEO043", "comment": null}, "DXCCSR_NEO044": {"type": "NUMBER", "index": 408, "name": "DXCCSR_NEO044", "comment": null}, "DXCCSR_NEO045": {"type": "NUMBER", "index": 409, "name": "DXCCSR_NEO045", "comment": null}, "DXCCSR_NEO046": {"type": "NUMBER", "index": 410, "name": "DXCCSR_NEO046", "comment": null}, "DXCCSR_NEO047": {"type": "NUMBER", "index": 411, "name": "DXCCSR_NEO047", "comment": null}, "DXCCSR_NEO048": {"type": "NUMBER", "index": 412, "name": "DXCCSR_NEO048", "comment": null}, "DXCCSR_NEO049": {"type": "NUMBER", "index": 413, "name": "DXCCSR_NEO049", "comment": null}, "DXCCSR_NEO050": {"type": "NUMBER", "index": 414, "name": "DXCCSR_NEO050", "comment": null}, "DXCCSR_NEO051": {"type": "NUMBER", "index": 415, "name": "DXCCSR_NEO051", "comment": null}, "DXCCSR_NEO052": {"type": "NUMBER", "index": 416, "name": "DXCCSR_NEO052", "comment": null}, "DXCCSR_NEO053": {"type": "NUMBER", "index": 417, "name": "DXCCSR_NEO053", "comment": null}, "DXCCSR_NEO054": {"type": "NUMBER", "index": 418, "name": "DXCCSR_NEO054", "comment": null}, "DXCCSR_NEO055": {"type": "NUMBER", "index": 419, "name": "DXCCSR_NEO055", "comment": null}, "DXCCSR_NEO056": {"type": "NUMBER", "index": 420, "name": "DXCCSR_NEO056", "comment": null}, "DXCCSR_NEO057": {"type": "NUMBER", "index": 421, "name": "DXCCSR_NEO057", "comment": null}, "DXCCSR_NEO058": {"type": "NUMBER", "index": 422, "name": "DXCCSR_NEO058", "comment": null}, "DXCCSR_NEO059": {"type": "NUMBER", "index": 423, "name": "DXCCSR_NEO059", "comment": null}, "DXCCSR_NEO060": {"type": "NUMBER", "index": 424, "name": "DXCCSR_NEO060", "comment": null}, "DXCCSR_NEO061": {"type": "NUMBER", "index": 425, "name": "DXCCSR_NEO061", "comment": null}, "DXCCSR_NEO062": {"type": "NUMBER", "index": 426, "name": "DXCCSR_NEO062", "comment": null}, "DXCCSR_NEO063": {"type": "NUMBER", "index": 427, "name": "DXCCSR_NEO063", "comment": null}, "DXCCSR_NEO064": {"type": "NUMBER", "index": 428, "name": "DXCCSR_NEO064", "comment": null}, "DXCCSR_NEO065": {"type": "NUMBER", "index": 429, "name": "DXCCSR_NEO065", "comment": null}, "DXCCSR_NEO066": {"type": "NUMBER", "index": 430, "name": "DXCCSR_NEO066", "comment": null}, "DXCCSR_NEO067": {"type": "NUMBER", "index": 431, "name": "DXCCSR_NEO067", "comment": null}, "DXCCSR_NEO068": {"type": "NUMBER", "index": 432, "name": "DXCCSR_NEO068", "comment": null}, "DXCCSR_NEO069": {"type": "NUMBER", "index": 433, "name": "DXCCSR_NEO069", "comment": null}, "DXCCSR_NEO070": {"type": "NUMBER", "index": 434, "name": "DXCCSR_NEO070", "comment": null}, "DXCCSR_NEO071": {"type": "NUMBER", "index": 435, "name": "DXCCSR_NEO071", "comment": null}, "DXCCSR_NEO072": {"type": "NUMBER", "index": 436, "name": "DXCCSR_NEO072", "comment": null}, "DXCCSR_NEO073": {"type": "NUMBER", "index": 437, "name": "DXCCSR_NEO073", "comment": null}, "DXCCSR_NEO074": {"type": "NUMBER", "index": 438, "name": "DXCCSR_NEO074", "comment": null}, "DXCCSR_NVS001": {"type": "NUMBER", "index": 439, "name": "DXCCSR_NVS001", "comment": null}, "DXCCSR_NVS002": {"type": "NUMBER", "index": 440, "name": "DXCCSR_NVS002", "comment": null}, "DXCCSR_NVS003": {"type": "NUMBER", "index": 441, "name": "DXCCSR_NVS003", "comment": null}, "DXCCSR_NVS004": {"type": "NUMBER", "index": 442, "name": "DXCCSR_NVS004", "comment": null}, "DXCCSR_NVS005": {"type": "NUMBER", "index": 443, "name": "DXCCSR_NVS005", "comment": null}, "DXCCSR_NVS006": {"type": "NUMBER", "index": 444, "name": "DXCCSR_NVS006", "comment": null}, "DXCCSR_NVS007": {"type": "NUMBER", "index": 445, "name": "DXCCSR_NVS007", "comment": null}, "DXCCSR_NVS008": {"type": "NUMBER", "index": 446, "name": "DXCCSR_NVS008", "comment": null}, "DXCCSR_NVS009": {"type": "NUMBER", "index": 447, "name": "DXCCSR_NVS009", "comment": null}, "DXCCSR_NVS010": {"type": "NUMBER", "index": 448, "name": "DXCCSR_NVS010", "comment": null}, "DXCCSR_NVS011": {"type": "NUMBER", "index": 449, "name": "DXCCSR_NVS011", "comment": null}, "DXCCSR_NVS012": {"type": "NUMBER", "index": 450, "name": "DXCCSR_NVS012", "comment": null}, "DXCCSR_NVS013": {"type": "NUMBER", "index": 451, "name": "DXCCSR_NVS013", "comment": null}, "DXCCSR_NVS014": {"type": "NUMBER", "index": 452, "name": "DXCCSR_NVS014", "comment": null}, "DXCCSR_NVS015": {"type": "NUMBER", "index": 453, "name": "DXCCSR_NVS015", "comment": null}, "DXCCSR_NVS016": {"type": "NUMBER", "index": 454, "name": "DXCCSR_NVS016", "comment": null}, "DXCCSR_NVS017": {"type": "NUMBER", "index": 455, "name": "DXCCSR_NVS017", "comment": null}, "DXCCSR_NVS018": {"type": "NUMBER", "index": 456, "name": "DXCCSR_NVS018", "comment": null}, "DXCCSR_NVS019": {"type": "NUMBER", "index": 457, "name": "DXCCSR_NVS019", "comment": null}, "DXCCSR_NVS020": {"type": "NUMBER", "index": 458, "name": "DXCCSR_NVS020", "comment": null}, "DXCCSR_NVS021": {"type": "NUMBER", "index": 459, "name": "DXCCSR_NVS021", "comment": null}, "DXCCSR_NVS022": {"type": "NUMBER", "index": 460, "name": "DXCCSR_NVS022", "comment": null}, "DXCCSR_PNL001": {"type": "NUMBER", "index": 461, "name": "DXCCSR_PNL001", "comment": null}, "DXCCSR_PNL002": {"type": "NUMBER", "index": 462, "name": "DXCCSR_PNL002", "comment": null}, "DXCCSR_PNL003": {"type": "NUMBER", "index": 463, "name": "DXCCSR_PNL003", "comment": null}, "DXCCSR_PNL004": {"type": "NUMBER", "index": 464, "name": "DXCCSR_PNL004", "comment": null}, "DXCCSR_PNL005": {"type": "NUMBER", "index": 465, "name": "DXCCSR_PNL005", "comment": null}, "DXCCSR_PNL006": {"type": "NUMBER", "index": 466, "name": "DXCCSR_PNL006", "comment": null}, "DXCCSR_PNL007": {"type": "NUMBER", "index": 467, "name": "DXCCSR_PNL007", "comment": null}, "DXCCSR_PNL008": {"type": "NUMBER", "index": 468, "name": "DXCCSR_PNL008", "comment": null}, "DXCCSR_PNL009": {"type": "NUMBER", "index": 469, "name": "DXCCSR_PNL009", "comment": null}, "DXCCSR_PNL010": {"type": "NUMBER", "index": 470, "name": "DXCCSR_PNL010", "comment": null}, "DXCCSR_PNL011": {"type": "NUMBER", "index": 471, "name": "DXCCSR_PNL011", "comment": null}, "DXCCSR_PNL012": {"type": "NUMBER", "index": 472, "name": "DXCCSR_PNL012", "comment": null}, "DXCCSR_PNL013": {"type": "NUMBER", "index": 473, "name": "DXCCSR_PNL013", "comment": null}, "DXCCSR_PNL014": {"type": "NUMBER", "index": 474, "name": "DXCCSR_PNL014", "comment": null}, "DXCCSR_PNL015": {"type": "NUMBER", "index": 475, "name": "DXCCSR_PNL015", "comment": null}, "DXCCSR_PRG001": {"type": "NUMBER", "index": 476, "name": "DXCCSR_PRG001", "comment": null}, "DXCCSR_PRG002": {"type": "NUMBER", "index": 477, "name": "DXCCSR_PRG002", "comment": null}, "DXCCSR_PRG003": {"type": "NUMBER", "index": 478, "name": "DXCCSR_PRG003", "comment": null}, "DXCCSR_PRG004": {"type": "NUMBER", "index": 479, "name": "DXCCSR_PRG004", "comment": null}, "DXCCSR_PRG005": {"type": "NUMBER", "index": 480, "name": "DXCCSR_PRG005", "comment": null}, "DXCCSR_PRG006": {"type": "NUMBER", "index": 481, "name": "DXCCSR_PRG006", "comment": null}, "DXCCSR_PRG007": {"type": "NUMBER", "index": 482, "name": "DXCCSR_PRG007", "comment": null}, "DXCCSR_PRG008": {"type": "NUMBER", "index": 483, "name": "DXCCSR_PRG008", "comment": null}, "DXCCSR_PRG009": {"type": "NUMBER", "index": 484, "name": "DXCCSR_PRG009", "comment": null}, "DXCCSR_PRG010": {"type": "NUMBER", "index": 485, "name": "DXCCSR_PRG010", "comment": null}, "DXCCSR_PRG011": {"type": "NUMBER", "index": 486, "name": "DXCCSR_PRG011", "comment": null}, "DXCCSR_PRG012": {"type": "NUMBER", "index": 487, "name": "DXCCSR_PRG012", "comment": null}, "DXCCSR_PRG013": {"type": "NUMBER", "index": 488, "name": "DXCCSR_PRG013", "comment": null}, "DXCCSR_PRG014": {"type": "NUMBER", "index": 489, "name": "DXCCSR_PRG014", "comment": null}, "DXCCSR_PRG015": {"type": "NUMBER", "index": 490, "name": "DXCCSR_PRG015", "comment": null}, "DXCCSR_PRG016": {"type": "NUMBER", "index": 491, "name": "DXCCSR_PRG016", "comment": null}, "DXCCSR_PRG017": {"type": "NUMBER", "index": 492, "name": "DXCCSR_PRG017", "comment": null}, "DXCCSR_PRG018": {"type": "NUMBER", "index": 493, "name": "DXCCSR_PRG018", "comment": null}, "DXCCSR_PRG019": {"type": "NUMBER", "index": 494, "name": "DXCCSR_PRG019", "comment": null}, "DXCCSR_PRG020": {"type": "NUMBER", "index": 495, "name": "DXCCSR_PRG020", "comment": null}, "DXCCSR_PRG021": {"type": "NUMBER", "index": 496, "name": "DXCCSR_PRG021", "comment": null}, "DXCCSR_PRG022": {"type": "NUMBER", "index": 497, "name": "DXCCSR_PRG022", "comment": null}, "DXCCSR_PRG023": {"type": "NUMBER", "index": 498, "name": "DXCCSR_PRG023", "comment": null}, "DXCCSR_PRG024": {"type": "NUMBER", "index": 499, "name": "DXCCSR_PRG024", "comment": null}, "DXCCSR_PRG025": {"type": "NUMBER", "index": 500, "name": "DXCCSR_PRG025", "comment": null}, "DXCCSR_PRG026": {"type": "NUMBER", "index": 501, "name": "DXCCSR_PRG026", "comment": null}, "DXCCSR_PRG027": {"type": "NUMBER", "index": 502, "name": "DXCCSR_PRG027", "comment": null}, "DXCCSR_PRG028": {"type": "NUMBER", "index": 503, "name": "DXCCSR_PRG028", "comment": null}, "DXCCSR_PRG029": {"type": "NUMBER", "index": 504, "name": "DXCCSR_PRG029", "comment": null}, "DXCCSR_PRG030": {"type": "NUMBER", "index": 505, "name": "DXCCSR_PRG030", "comment": null}, "DXCCSR_RSP001": {"type": "NUMBER", "index": 506, "name": "DXCCSR_RSP001", "comment": null}, "DXCCSR_RSP002": {"type": "NUMBER", "index": 507, "name": "DXCCSR_RSP002", "comment": null}, "DXCCSR_RSP003": {"type": "NUMBER", "index": 508, "name": "DXCCSR_RSP003", "comment": null}, "DXCCSR_RSP004": {"type": "NUMBER", "index": 509, "name": "DXCCSR_RSP004", "comment": null}, "DXCCSR_RSP005": {"type": "NUMBER", "index": 510, "name": "DXCCSR_RSP005", "comment": null}, "DXCCSR_RSP006": {"type": "NUMBER", "index": 511, "name": "DXCCSR_RSP006", "comment": null}, "DXCCSR_RSP007": {"type": "NUMBER", "index": 512, "name": "DXCCSR_RSP007", "comment": null}, "DXCCSR_RSP008": {"type": "NUMBER", "index": 513, "name": "DXCCSR_RSP008", "comment": null}, "DXCCSR_RSP009": {"type": "NUMBER", "index": 514, "name": "DXCCSR_RSP009", "comment": null}, "DXCCSR_RSP010": {"type": "NUMBER", "index": 515, "name": "DXCCSR_RSP010", "comment": null}, "DXCCSR_RSP011": {"type": "NUMBER", "index": 516, "name": "DXCCSR_RSP011", "comment": null}, "DXCCSR_RSP012": {"type": "NUMBER", "index": 517, "name": "DXCCSR_RSP012", "comment": null}, "DXCCSR_RSP013": {"type": "NUMBER", "index": 518, "name": "DXCCSR_RSP013", "comment": null}, "DXCCSR_RSP014": {"type": "NUMBER", "index": 519, "name": "DXCCSR_RSP014", "comment": null}, "DXCCSR_RSP015": {"type": "NUMBER", "index": 520, "name": "DXCCSR_RSP015", "comment": null}, "DXCCSR_RSP016": {"type": "NUMBER", "index": 521, "name": "DXCCSR_RSP016", "comment": null}, "DXCCSR_RSP017": {"type": "NUMBER", "index": 522, "name": "DXCCSR_RSP017", "comment": null}, "DXCCSR_SKN001": {"type": "NUMBER", "index": 523, "name": "DXCCSR_SKN001", "comment": null}, "DXCCSR_SKN002": {"type": "NUMBER", "index": 524, "name": "DXCCSR_SKN002", "comment": null}, "DXCCSR_SKN003": {"type": "NUMBER", "index": 525, "name": "DXCCSR_SKN003", "comment": null}, "DXCCSR_SKN004": {"type": "NUMBER", "index": 526, "name": "DXCCSR_SKN004", "comment": null}, "DXCCSR_SKN005": {"type": "NUMBER", "index": 527, "name": "DXCCSR_SKN005", "comment": null}, "DXCCSR_SKN006": {"type": "NUMBER", "index": 528, "name": "DXCCSR_SKN006", "comment": null}, "DXCCSR_SKN007": {"type": "NUMBER", "index": 529, "name": "DXCCSR_SKN007", "comment": null}, "DXCCSR_SYM001": {"type": "NUMBER", "index": 530, "name": "DXCCSR_SYM001", "comment": null}, "DXCCSR_SYM002": {"type": "NUMBER", "index": 531, "name": "DXCCSR_SYM002", "comment": null}, "DXCCSR_SYM003": {"type": "NUMBER", "index": 532, "name": "DXCCSR_SYM003", "comment": null}, "DXCCSR_SYM004": {"type": "NUMBER", "index": 533, "name": "DXCCSR_SYM004", "comment": null}, "DXCCSR_SYM005": {"type": "NUMBER", "index": 534, "name": "DXCCSR_SYM005", "comment": null}, "DXCCSR_SYM006": {"type": "NUMBER", "index": 535, "name": "DXCCSR_SYM006", "comment": null}, "DXCCSR_SYM007": {"type": "NUMBER", "index": 536, "name": "DXCCSR_SYM007", "comment": null}, "DXCCSR_SYM008": {"type": "NUMBER", "index": 537, "name": "DXCCSR_SYM008", "comment": null}, "DXCCSR_SYM009": {"type": "NUMBER", "index": 538, "name": "DXCCSR_SYM009", "comment": null}, "DXCCSR_SYM010": {"type": "NUMBER", "index": 539, "name": "DXCCSR_SYM010", "comment": null}, "DXCCSR_SYM011": {"type": "NUMBER", "index": 540, "name": "DXCCSR_SYM011", "comment": null}, "DXCCSR_SYM012": {"type": "NUMBER", "index": 541, "name": "DXCCSR_SYM012", "comment": null}, "DXCCSR_SYM013": {"type": "NUMBER", "index": 542, "name": "DXCCSR_SYM013", "comment": null}, "DXCCSR_SYM014": {"type": "NUMBER", "index": 543, "name": "DXCCSR_SYM014", "comment": null}, "DXCCSR_SYM015": {"type": "NUMBER", "index": 544, "name": "DXCCSR_SYM015", "comment": null}, "DXCCSR_SYM016": {"type": "NUMBER", "index": 545, "name": "DXCCSR_SYM016", "comment": null}, "DXCCSR_SYM017": {"type": "NUMBER", "index": 546, "name": "DXCCSR_SYM017", "comment": null}, "DXCCSR_VERSION": {"type": "TEXT", "index": 547, "name": "DXCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 548, "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": "2023-09-05 20:36UTC", "include": true, "description": "The timestamp for last update/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__wide_condition_category"}, "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": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_HIERARCHY", "database": "TUVA", "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": {"row_count": {"id": "row_count", "label": "Row Count", "value": 72.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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.quality_measures_reporting__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_VALUE_SET_CODES", "database": "TUVA", "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": 4101.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 44032.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.quality_measures_reporting__value_sets"}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUDE_MASTECTOMY", "database": "TUVA", "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}}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclude_mastectomy"}, "model.the_tuva_project.readmissions__planned_encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PLANNED_ENCOUNTER", "database": "TUVA", "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.quality_measures_reporting__int_nqf2372_exclude_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUDE_DEMENTIA", "database": "TUVA", "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}}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclude_dementia"}, "model.the_tuva_project.core__patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "TEXT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.financial_pmpm__member_months": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "MEMBER_MONTHS", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.readmissions__readmission_crude": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_READMISSION_CRUDE", "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}, "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.readmissions__encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_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}, "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}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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.readmissions__encounter"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, "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": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "NUMBER", "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": 147456.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, "model.the_tuva_project.data_profiling__eligibility_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_PLAUSIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 6, "name": "PATIENT_ID", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__eligibility_plausibility"}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_REHAB_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__ambulance_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULANCE_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "TUVA", "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": 2.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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUDE_ADVANCED_ILLNESS", "database": "TUVA", "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}}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclude_advanced_illness"}, "model.the_tuva_project.readmissions__encounter_data_quality": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_DATA_QUALITY", "database": "TUVA", "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}, "MULTIPLE_PRIMARY_DIAGNOSES_FLAG": {"type": "NUMBER", "index": 10, "name": "MULTIPLE_PRIMARY_DIAGNOSES_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 11, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 12, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 13, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 14, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 15, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "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.core__stg_clinical_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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"}, "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": "TUVA", "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}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 55368.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 300032.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, "model.the_tuva_project.core__location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.readmissions__index_admission": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_ADMISSION", "database": "TUVA", "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.chronic_conditions__cms_chronic_conditions_all": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_ALL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.quality_measures_reporting__concepts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_VALUE_SET_CONCEPTS", "database": "TUVA", "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": 36.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": "2023-09-05 16: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": "seed.the_tuva_project.quality_measures_reporting__concepts"}, "model.claims_data_model.condition": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "TEXT", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "TEXT", "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": "TEXT", "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": "TEXT", "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.claims_data_model.condition"}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INVALID_VALUES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 6, "name": "CLAIM_ID", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "FILLED_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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__medical_claim_invalid_values"}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_CLAIMS", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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__revenue_center": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "REVENUE_CENTER", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__revenue_center"}, "model.the_tuva_project.core__stg_clinical_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "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": "TEXT", "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.terminology__icd_9_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_PCS", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__icd_9_pcs"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_WIDE", "database": "TUVA", "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}, "ALCOHOL": {"type": "NUMBER", "index": 3, "name": "ALCOHOL", "comment": null}, "ALZHEIMERS_DISEASE": {"type": "NUMBER", "index": 4, "name": "ALZHEIMERS_DISEASE", "comment": null}, "AMYOTROPHIC_LATERAL_SCLEROSIS": {"type": "NUMBER", "index": 5, "name": "AMYOTROPHIC_LATERAL_SCLEROSIS", "comment": null}, "ANXIETY": {"type": "NUMBER", "index": 6, "name": "ANXIETY", "comment": null}, "ASTHMA": {"type": "NUMBER", "index": 7, "name": "ASTHMA", "comment": null}, "ATHEROSCLEROSIS": {"type": "NUMBER", "index": 8, "name": "ATHEROSCLEROSIS", "comment": null}, "ATRIAL_FIBRILLATION": {"type": "NUMBER", "index": 9, "name": "ATRIAL_FIBRILLATION", "comment": null}, "ATTENTION_DEFICIT_HYPERACTIVITY_DISORDER": {"type": "NUMBER", "index": 10, "name": "ATTENTION_DEFICIT_HYPERACTIVITY_DISORDER", "comment": null}, "BIPOLAR": {"type": "NUMBER", "index": 11, "name": "BIPOLAR", "comment": null}, "BREAST_CANCER": {"type": "NUMBER", "index": 12, "name": "BREAST_CANCER", "comment": null}, "CHRONIC_KIDNEY_DISEASE": {"type": "NUMBER", "index": 13, "name": "CHRONIC_KIDNEY_DISEASE", "comment": null}, "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE": {"type": "NUMBER", "index": 14, "name": "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE", "comment": null}, "COCAINE": {"type": "NUMBER", "index": 15, "name": "COCAINE", "comment": null}, "COLORECTAL_CANCER": {"type": "NUMBER", "index": 16, "name": "COLORECTAL_CANCER", "comment": null}, "CROHNS_DISEASE": {"type": "NUMBER", "index": 17, "name": "CROHNS_DISEASE", "comment": null}, "CYSTIC_FIBROSIS": {"type": "NUMBER", "index": 18, "name": "CYSTIC_FIBROSIS", "comment": null}, "DEMENTIA": {"type": "NUMBER", "index": 19, "name": "DEMENTIA", "comment": null}, "DEPRESSION": {"type": "NUMBER", "index": 20, "name": "DEPRESSION", "comment": null}, "HEART_FAILURE": {"type": "NUMBER", "index": 21, "name": "HEART_FAILURE", "comment": null}, "HYPERLIPIDEMIA": {"type": "NUMBER", "index": 22, "name": "HYPERLIPIDEMIA", "comment": null}, "HYPERTENSION": {"type": "NUMBER", "index": 23, "name": "HYPERTENSION", "comment": null}, "LUNG_CANCER": {"type": "NUMBER", "index": 24, "name": "LUNG_CANCER", "comment": null}, "LUPUS": {"type": "NUMBER", "index": 25, "name": "LUPUS", "comment": null}, "METABOLIC_SYNDROME": {"type": "NUMBER", "index": 26, "name": "METABOLIC_SYNDROME", "comment": null}, "MULTIPLE_SCLEROSIS": {"type": "NUMBER", "index": 27, "name": "MULTIPLE_SCLEROSIS", "comment": null}, "MUSCULAR_DYSTROPHY": {"type": "NUMBER", "index": 28, "name": "MUSCULAR_DYSTROPHY", "comment": null}, "OBESITY": {"type": "NUMBER", "index": 29, "name": "OBESITY", "comment": null}, "OBSESSIVE_COMPULSIVE_DISORDER": {"type": "NUMBER", "index": 30, "name": "OBSESSIVE_COMPULSIVE_DISORDER", "comment": null}, "OPIOID": {"type": "NUMBER", "index": 31, "name": "OPIOID", "comment": null}, "PARKINSONS_DISEASE": {"type": "NUMBER", "index": 32, "name": "PARKINSONS_DISEASE", "comment": null}, "PERSONALITY_DISORDER": {"type": "NUMBER", "index": 33, "name": "PERSONALITY_DISORDER", "comment": null}, "POST_TRAUMATIC_STRESS_DISORDER": {"type": "NUMBER", "index": 34, "name": "POST_TRAUMATIC_STRESS_DISORDER", "comment": null}, "RHEUMATOID_ARTHRITIS": {"type": "NUMBER", "index": 35, "name": "RHEUMATOID_ARTHRITIS", "comment": null}, "SCHIZOPHRENIA": {"type": "NUMBER", "index": 36, "name": "SCHIZOPHRENIA", "comment": null}, "STROKE": {"type": "NUMBER", "index": 37, "name": "STROKE", "comment": null}, "TOBACCO": {"type": "NUMBER", "index": 38, "name": "TOBACCO", "comment": null}, "TYPE_1_DIABETES": {"type": "NUMBER", "index": 39, "name": "TYPE_1_DIABETES", "comment": null}, "TYPE_2_DIABETES": {"type": "NUMBER", "index": 40, "name": "TYPE_2_DIABETES", "comment": null}, "ULCERATIVE_COLITIS": {"type": "NUMBER", "index": 41, "name": "ULCERATIVE_COLITIS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 42, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.readmissions__always_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "TUVA", "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": 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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, "model.the_tuva_project.data_profiling__professional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAILURES", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 138, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__professional_header_failures"}, "model.the_tuva_project.core__stg_clinical_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "TUVA_LAST_RUN": {"type": "TEXT", "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.readmissions__index_discharge_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_DISCHARGE_REQUIREMENT", "database": "TUVA", "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"}, "seed.the_tuva_project.readmissions__specialty_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SPECIALTY_COHORT", "database": "TUVA", "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": 276.0, "include": true, "description": "An approximate count of rows in this table"}, "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__specialty_cohort"}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DEMOGRAPHIC_FACTORS", "database": "TUVA", "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": 424.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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__demographic_factors"}, "seed.the_tuva_project.terminology__admit_source": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_SOURCE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__admit_source"}, "model.the_tuva_project.data_profiling__test_result": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_RESULT", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_result"}, "model.the_tuva_project.ccsr__wide_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "WIDE_PROCEDURE_CATEGORY", "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}, "PRCCSR_ADM001": {"type": "NUMBER", "index": 3, "name": "PRCCSR_ADM001", "comment": null}, "PRCCSR_ADM002": {"type": "NUMBER", "index": 4, "name": "PRCCSR_ADM002", "comment": null}, "PRCCSR_ADM003": {"type": "NUMBER", "index": 5, "name": "PRCCSR_ADM003", "comment": null}, "PRCCSR_ADM004": {"type": "NUMBER", "index": 6, "name": "PRCCSR_ADM004", "comment": null}, "PRCCSR_ADM005": {"type": "NUMBER", "index": 7, "name": "PRCCSR_ADM005", "comment": null}, "PRCCSR_ADM006": {"type": "NUMBER", "index": 8, "name": "PRCCSR_ADM006", "comment": null}, "PRCCSR_ADM007": {"type": "NUMBER", "index": 9, "name": "PRCCSR_ADM007", "comment": null}, "PRCCSR_ADM008": {"type": "NUMBER", "index": 10, "name": "PRCCSR_ADM008", "comment": null}, "PRCCSR_ADM009": {"type": "NUMBER", "index": 11, "name": "PRCCSR_ADM009", "comment": null}, "PRCCSR_ADM010": {"type": "NUMBER", "index": 12, "name": "PRCCSR_ADM010", "comment": null}, "PRCCSR_ADM011": {"type": "NUMBER", "index": 13, "name": "PRCCSR_ADM011", "comment": null}, "PRCCSR_ADM012": {"type": "NUMBER", "index": 14, "name": "PRCCSR_ADM012", "comment": null}, "PRCCSR_ADM013": {"type": "NUMBER", "index": 15, "name": "PRCCSR_ADM013", "comment": null}, "PRCCSR_ADM014": {"type": "NUMBER", "index": 16, "name": "PRCCSR_ADM014", "comment": null}, "PRCCSR_ADM015": {"type": "NUMBER", "index": 17, "name": "PRCCSR_ADM015", "comment": null}, "PRCCSR_ADM016": {"type": "NUMBER", "index": 18, "name": "PRCCSR_ADM016", "comment": null}, "PRCCSR_ADM017": {"type": "NUMBER", "index": 19, "name": "PRCCSR_ADM017", "comment": null}, "PRCCSR_ADM018": {"type": "NUMBER", "index": 20, "name": "PRCCSR_ADM018", "comment": null}, "PRCCSR_ADM019": {"type": "NUMBER", "index": 21, "name": "PRCCSR_ADM019", "comment": null}, "PRCCSR_ADM020": {"type": "NUMBER", "index": 22, "name": "PRCCSR_ADM020", "comment": null}, "PRCCSR_ADM021": {"type": "NUMBER", "index": 23, "name": "PRCCSR_ADM021", "comment": null}, "PRCCSR_ADM022": {"type": "NUMBER", "index": 24, "name": "PRCCSR_ADM022", "comment": null}, "PRCCSR_CAR001": {"type": "NUMBER", "index": 25, "name": "PRCCSR_CAR001", "comment": null}, "PRCCSR_CAR002": {"type": "NUMBER", "index": 26, "name": "PRCCSR_CAR002", "comment": null}, "PRCCSR_CAR003": {"type": "NUMBER", "index": 27, "name": "PRCCSR_CAR003", "comment": null}, "PRCCSR_CAR004": {"type": "NUMBER", "index": 28, "name": "PRCCSR_CAR004", "comment": null}, "PRCCSR_CAR005": {"type": "NUMBER", "index": 29, "name": "PRCCSR_CAR005", "comment": null}, "PRCCSR_CAR006": {"type": "NUMBER", "index": 30, "name": "PRCCSR_CAR006", "comment": null}, "PRCCSR_CAR007": {"type": "NUMBER", "index": 31, "name": "PRCCSR_CAR007", "comment": null}, "PRCCSR_CAR008": {"type": "NUMBER", "index": 32, "name": "PRCCSR_CAR008", "comment": null}, "PRCCSR_CAR009": {"type": "NUMBER", "index": 33, "name": "PRCCSR_CAR009", "comment": null}, "PRCCSR_CAR010": {"type": "NUMBER", "index": 34, "name": "PRCCSR_CAR010", "comment": null}, "PRCCSR_CAR011": {"type": "NUMBER", "index": 35, "name": "PRCCSR_CAR011", "comment": null}, "PRCCSR_CAR012": {"type": "NUMBER", "index": 36, "name": "PRCCSR_CAR012", "comment": null}, "PRCCSR_CAR013": {"type": "NUMBER", "index": 37, "name": "PRCCSR_CAR013", "comment": null}, "PRCCSR_CAR014": {"type": "NUMBER", "index": 38, "name": "PRCCSR_CAR014", "comment": null}, "PRCCSR_CAR015": {"type": "NUMBER", "index": 39, "name": "PRCCSR_CAR015", "comment": null}, "PRCCSR_CAR016": {"type": "NUMBER", "index": 40, "name": "PRCCSR_CAR016", "comment": null}, "PRCCSR_CAR017": {"type": "NUMBER", "index": 41, "name": "PRCCSR_CAR017", "comment": null}, "PRCCSR_CAR018": {"type": "NUMBER", "index": 42, "name": "PRCCSR_CAR018", "comment": null}, "PRCCSR_CAR019": {"type": "NUMBER", "index": 43, "name": "PRCCSR_CAR019", "comment": null}, "PRCCSR_CAR020": {"type": "NUMBER", "index": 44, "name": "PRCCSR_CAR020", "comment": null}, "PRCCSR_CAR021": {"type": "NUMBER", "index": 45, "name": "PRCCSR_CAR021", "comment": null}, "PRCCSR_CAR022": {"type": "NUMBER", "index": 46, "name": "PRCCSR_CAR022", "comment": null}, "PRCCSR_CAR023": {"type": "NUMBER", "index": 47, "name": "PRCCSR_CAR023", "comment": null}, "PRCCSR_CAR024": {"type": "NUMBER", "index": 48, "name": "PRCCSR_CAR024", "comment": null}, "PRCCSR_CAR025": {"type": "NUMBER", "index": 49, "name": "PRCCSR_CAR025", "comment": null}, "PRCCSR_CAR026": {"type": "NUMBER", "index": 50, "name": "PRCCSR_CAR026", "comment": null}, "PRCCSR_CAR027": {"type": "NUMBER", "index": 51, "name": "PRCCSR_CAR027", "comment": null}, "PRCCSR_CAR028": {"type": "NUMBER", "index": 52, "name": "PRCCSR_CAR028", "comment": null}, "PRCCSR_CAR029": {"type": "NUMBER", "index": 53, "name": "PRCCSR_CAR029", "comment": null}, "PRCCSR_CHP001": {"type": "NUMBER", "index": 54, "name": "PRCCSR_CHP001", "comment": null}, "PRCCSR_CNS001": {"type": "NUMBER", "index": 55, "name": "PRCCSR_CNS001", "comment": null}, "PRCCSR_CNS002": {"type": "NUMBER", "index": 56, "name": "PRCCSR_CNS002", "comment": null}, "PRCCSR_CNS003": {"type": "NUMBER", "index": 57, "name": "PRCCSR_CNS003", "comment": null}, "PRCCSR_CNS004": {"type": "NUMBER", "index": 58, "name": "PRCCSR_CNS004", "comment": null}, "PRCCSR_CNS005": {"type": "NUMBER", "index": 59, "name": "PRCCSR_CNS005", "comment": null}, "PRCCSR_CNS006": {"type": "NUMBER", "index": 60, "name": "PRCCSR_CNS006", "comment": null}, "PRCCSR_CNS007": {"type": "NUMBER", "index": 61, "name": "PRCCSR_CNS007", "comment": null}, "PRCCSR_CNS008": {"type": "NUMBER", "index": 62, "name": "PRCCSR_CNS008", "comment": null}, "PRCCSR_CNS009": {"type": "NUMBER", "index": 63, "name": "PRCCSR_CNS009", "comment": null}, "PRCCSR_CNS010": {"type": "NUMBER", "index": 64, "name": "PRCCSR_CNS010", "comment": null}, "PRCCSR_CNS011": {"type": "NUMBER", "index": 65, "name": "PRCCSR_CNS011", "comment": null}, "PRCCSR_CNS012": {"type": "NUMBER", "index": 66, "name": "PRCCSR_CNS012", "comment": null}, "PRCCSR_CNS013": {"type": "NUMBER", "index": 67, "name": "PRCCSR_CNS013", "comment": null}, "PRCCSR_CNS014": {"type": "NUMBER", "index": 68, "name": "PRCCSR_CNS014", "comment": null}, "PRCCSR_ENP001": {"type": "NUMBER", "index": 69, "name": "PRCCSR_ENP001", "comment": null}, "PRCCSR_ENP002": {"type": "NUMBER", "index": 70, "name": "PRCCSR_ENP002", "comment": null}, "PRCCSR_ENP003": {"type": "NUMBER", "index": 71, "name": "PRCCSR_ENP003", "comment": null}, "PRCCSR_ENP004": {"type": "NUMBER", "index": 72, "name": "PRCCSR_ENP004", "comment": null}, "PRCCSR_ENP005": {"type": "NUMBER", "index": 73, "name": "PRCCSR_ENP005", "comment": null}, "PRCCSR_ENP006": {"type": "NUMBER", "index": 74, "name": "PRCCSR_ENP006", "comment": null}, "PRCCSR_ENT001": {"type": "NUMBER", "index": 75, "name": "PRCCSR_ENT001", "comment": null}, "PRCCSR_ENT002": {"type": "NUMBER", "index": 76, "name": "PRCCSR_ENT002", "comment": null}, "PRCCSR_ENT003": {"type": "NUMBER", "index": 77, "name": "PRCCSR_ENT003", "comment": null}, "PRCCSR_ENT004": {"type": "NUMBER", "index": 78, "name": "PRCCSR_ENT004", "comment": null}, "PRCCSR_ENT005": {"type": "NUMBER", "index": 79, "name": "PRCCSR_ENT005", "comment": null}, "PRCCSR_ENT006": {"type": "NUMBER", "index": 80, "name": "PRCCSR_ENT006", "comment": null}, "PRCCSR_ENT007": {"type": "NUMBER", "index": 81, "name": "PRCCSR_ENT007", "comment": null}, "PRCCSR_ENT008": {"type": "NUMBER", "index": 82, "name": "PRCCSR_ENT008", "comment": null}, "PRCCSR_ENT009": {"type": "NUMBER", "index": 83, "name": "PRCCSR_ENT009", "comment": null}, "PRCCSR_ENT010": {"type": "NUMBER", "index": 84, "name": "PRCCSR_ENT010", "comment": null}, "PRCCSR_ENT011": {"type": "NUMBER", "index": 85, "name": "PRCCSR_ENT011", "comment": null}, "PRCCSR_ENT012": {"type": "NUMBER", "index": 86, "name": "PRCCSR_ENT012", "comment": null}, "PRCCSR_ENT013": {"type": "NUMBER", "index": 87, "name": "PRCCSR_ENT013", "comment": null}, "PRCCSR_ENT014": {"type": "NUMBER", "index": 88, "name": "PRCCSR_ENT014", "comment": null}, "PRCCSR_ENT015": {"type": "NUMBER", "index": 89, "name": "PRCCSR_ENT015", "comment": null}, "PRCCSR_ENT016": {"type": "NUMBER", "index": 90, "name": "PRCCSR_ENT016", "comment": null}, "PRCCSR_ENT017": {"type": "NUMBER", "index": 91, "name": "PRCCSR_ENT017", "comment": null}, "PRCCSR_ESA001": {"type": "NUMBER", "index": 92, "name": "PRCCSR_ESA001", "comment": null}, "PRCCSR_ESA002": {"type": "NUMBER", "index": 93, "name": "PRCCSR_ESA002", "comment": null}, "PRCCSR_ESA003": {"type": "NUMBER", "index": 94, "name": "PRCCSR_ESA003", "comment": null}, "PRCCSR_ESA004": {"type": "NUMBER", "index": 95, "name": "PRCCSR_ESA004", "comment": null}, "PRCCSR_ESA005": {"type": "NUMBER", "index": 96, "name": "PRCCSR_ESA005", "comment": null}, "PRCCSR_ESA006": {"type": "NUMBER", "index": 97, "name": "PRCCSR_ESA006", "comment": null}, "PRCCSR_ESA007": {"type": "NUMBER", "index": 98, "name": "PRCCSR_ESA007", "comment": null}, "PRCCSR_ESA008": {"type": "NUMBER", "index": 99, "name": "PRCCSR_ESA008", "comment": null}, "PRCCSR_ESA009": {"type": "NUMBER", "index": 100, "name": "PRCCSR_ESA009", "comment": null}, "PRCCSR_ESA010": {"type": "NUMBER", "index": 101, "name": "PRCCSR_ESA010", "comment": null}, "PRCCSR_ESA011": {"type": "NUMBER", "index": 102, "name": "PRCCSR_ESA011", "comment": null}, "PRCCSR_EST001": {"type": "NUMBER", "index": 103, "name": "PRCCSR_EST001", "comment": null}, "PRCCSR_EST002": {"type": "NUMBER", "index": 104, "name": "PRCCSR_EST002", "comment": null}, "PRCCSR_EST003": {"type": "NUMBER", "index": 105, "name": "PRCCSR_EST003", "comment": null}, "PRCCSR_EST004": {"type": "NUMBER", "index": 106, "name": "PRCCSR_EST004", "comment": null}, "PRCCSR_EST005": {"type": "NUMBER", "index": 107, "name": "PRCCSR_EST005", "comment": null}, "PRCCSR_EYP001": {"type": "NUMBER", "index": 108, "name": "PRCCSR_EYP001", "comment": null}, "PRCCSR_EYP002": {"type": "NUMBER", "index": 109, "name": "PRCCSR_EYP002", "comment": null}, "PRCCSR_FRS001": {"type": "NUMBER", "index": 110, "name": "PRCCSR_FRS001", "comment": null}, "PRCCSR_FRS002": {"type": "NUMBER", "index": 111, "name": "PRCCSR_FRS002", "comment": null}, "PRCCSR_FRS003": {"type": "NUMBER", "index": 112, "name": "PRCCSR_FRS003", "comment": null}, "PRCCSR_FRS004": {"type": "NUMBER", "index": 113, "name": "PRCCSR_FRS004", "comment": null}, "PRCCSR_FRS005": {"type": "NUMBER", "index": 114, "name": "PRCCSR_FRS005", "comment": null}, "PRCCSR_FRS006": {"type": "NUMBER", "index": 115, "name": "PRCCSR_FRS006", "comment": null}, "PRCCSR_FRS007": {"type": "NUMBER", "index": 116, "name": "PRCCSR_FRS007", "comment": null}, "PRCCSR_FRS008": {"type": "NUMBER", "index": 117, "name": "PRCCSR_FRS008", "comment": null}, "PRCCSR_FRS009": {"type": "NUMBER", "index": 118, "name": "PRCCSR_FRS009", "comment": null}, "PRCCSR_FRS010": {"type": "NUMBER", "index": 119, "name": "PRCCSR_FRS010", "comment": null}, "PRCCSR_FRS011": {"type": "NUMBER", "index": 120, "name": "PRCCSR_FRS011", "comment": null}, "PRCCSR_FRS012": {"type": "NUMBER", "index": 121, "name": "PRCCSR_FRS012", "comment": null}, "PRCCSR_FRS013": {"type": "NUMBER", "index": 122, "name": "PRCCSR_FRS013", "comment": null}, "PRCCSR_FRS014": {"type": "NUMBER", "index": 123, "name": "PRCCSR_FRS014", "comment": null}, "PRCCSR_FRS015": {"type": "NUMBER", "index": 124, "name": "PRCCSR_FRS015", "comment": null}, "PRCCSR_GIS001": {"type": "NUMBER", "index": 125, "name": "PRCCSR_GIS001", "comment": null}, "PRCCSR_GIS002": {"type": "NUMBER", "index": 126, "name": "PRCCSR_GIS002", "comment": null}, "PRCCSR_GIS003": {"type": "NUMBER", "index": 127, "name": "PRCCSR_GIS003", "comment": null}, "PRCCSR_GIS004": {"type": "NUMBER", "index": 128, "name": "PRCCSR_GIS004", "comment": null}, "PRCCSR_GIS005": {"type": "NUMBER", "index": 129, "name": "PRCCSR_GIS005", "comment": null}, "PRCCSR_GIS006": {"type": "NUMBER", "index": 130, "name": "PRCCSR_GIS006", "comment": null}, "PRCCSR_GIS007": {"type": "NUMBER", "index": 131, "name": "PRCCSR_GIS007", "comment": null}, "PRCCSR_GIS008": {"type": "NUMBER", "index": 132, "name": "PRCCSR_GIS008", "comment": null}, "PRCCSR_GIS009": {"type": "NUMBER", "index": 133, "name": "PRCCSR_GIS009", "comment": null}, "PRCCSR_GIS010": {"type": "NUMBER", "index": 134, "name": "PRCCSR_GIS010", "comment": null}, "PRCCSR_GIS011": {"type": "NUMBER", "index": 135, "name": "PRCCSR_GIS011", "comment": null}, "PRCCSR_GIS012": {"type": "NUMBER", "index": 136, "name": "PRCCSR_GIS012", "comment": null}, "PRCCSR_GIS013": {"type": "NUMBER", "index": 137, "name": "PRCCSR_GIS013", "comment": null}, "PRCCSR_GIS014": {"type": "NUMBER", "index": 138, "name": "PRCCSR_GIS014", "comment": null}, "PRCCSR_GIS015": {"type": "NUMBER", "index": 139, "name": "PRCCSR_GIS015", "comment": null}, "PRCCSR_GIS016": {"type": "NUMBER", "index": 140, "name": "PRCCSR_GIS016", "comment": null}, "PRCCSR_GIS017": {"type": "NUMBER", "index": 141, "name": "PRCCSR_GIS017", "comment": null}, "PRCCSR_GIS018": {"type": "NUMBER", "index": 142, "name": "PRCCSR_GIS018", "comment": null}, "PRCCSR_GIS019": {"type": "NUMBER", "index": 143, "name": "PRCCSR_GIS019", "comment": null}, "PRCCSR_GIS020": {"type": "NUMBER", "index": 144, "name": "PRCCSR_GIS020", "comment": null}, "PRCCSR_GIS021": {"type": "NUMBER", "index": 145, "name": "PRCCSR_GIS021", "comment": null}, "PRCCSR_GIS022": {"type": "NUMBER", "index": 146, "name": "PRCCSR_GIS022", "comment": null}, "PRCCSR_GIS023": {"type": "NUMBER", "index": 147, "name": "PRCCSR_GIS023", "comment": null}, "PRCCSR_GIS024": {"type": "NUMBER", "index": 148, "name": "PRCCSR_GIS024", "comment": null}, "PRCCSR_GIS025": {"type": "NUMBER", "index": 149, "name": "PRCCSR_GIS025", "comment": null}, "PRCCSR_GIS026": {"type": "NUMBER", "index": 150, "name": "PRCCSR_GIS026", "comment": null}, "PRCCSR_GIS027": {"type": "NUMBER", "index": 151, "name": "PRCCSR_GIS027", "comment": null}, "PRCCSR_GIS028": {"type": "NUMBER", "index": 152, "name": "PRCCSR_GIS028", "comment": null}, "PRCCSR_GIS029": {"type": "NUMBER", "index": 153, "name": "PRCCSR_GIS029", "comment": null}, "PRCCSR_GNR001": {"type": "NUMBER", "index": 154, "name": "PRCCSR_GNR001", "comment": null}, "PRCCSR_GNR002": {"type": "NUMBER", "index": 155, "name": "PRCCSR_GNR002", "comment": null}, "PRCCSR_GNR003": {"type": "NUMBER", "index": 156, "name": "PRCCSR_GNR003", "comment": null}, "PRCCSR_GNR004": {"type": "NUMBER", "index": 157, "name": "PRCCSR_GNR004", "comment": null}, "PRCCSR_GNR005": {"type": "NUMBER", "index": 158, "name": "PRCCSR_GNR005", "comment": null}, "PRCCSR_GNR006": {"type": "NUMBER", "index": 159, "name": "PRCCSR_GNR006", "comment": null}, "PRCCSR_GNR007": {"type": "NUMBER", "index": 160, "name": "PRCCSR_GNR007", "comment": null}, "PRCCSR_GNR008": {"type": "NUMBER", "index": 161, "name": "PRCCSR_GNR008", "comment": null}, "PRCCSR_GNR009": {"type": "NUMBER", "index": 162, "name": "PRCCSR_GNR009", "comment": null}, "PRCCSR_GNR010": {"type": "NUMBER", "index": 163, "name": "PRCCSR_GNR010", "comment": null}, "PRCCSR_HEP001": {"type": "NUMBER", "index": 164, "name": "PRCCSR_HEP001", "comment": null}, "PRCCSR_HEP002": {"type": "NUMBER", "index": 165, "name": "PRCCSR_HEP002", "comment": null}, "PRCCSR_HEP003": {"type": "NUMBER", "index": 166, "name": "PRCCSR_HEP003", "comment": null}, "PRCCSR_HEP004": {"type": "NUMBER", "index": 167, "name": "PRCCSR_HEP004", "comment": null}, "PRCCSR_HEP005": {"type": "NUMBER", "index": 168, "name": "PRCCSR_HEP005", "comment": null}, "PRCCSR_HEP006": {"type": "NUMBER", "index": 169, "name": "PRCCSR_HEP006", "comment": null}, "PRCCSR_HEP007": {"type": "NUMBER", "index": 170, "name": "PRCCSR_HEP007", "comment": null}, "PRCCSR_HEP008": {"type": "NUMBER", "index": 171, "name": "PRCCSR_HEP008", "comment": null}, "PRCCSR_HEP009": {"type": "NUMBER", "index": 172, "name": "PRCCSR_HEP009", "comment": null}, "PRCCSR_HEP010": {"type": "NUMBER", "index": 173, "name": "PRCCSR_HEP010", "comment": null}, "PRCCSR_HEP011": {"type": "NUMBER", "index": 174, "name": "PRCCSR_HEP011", "comment": null}, "PRCCSR_HEP012": {"type": "NUMBER", "index": 175, "name": "PRCCSR_HEP012", "comment": null}, "PRCCSR_HEP013": {"type": "NUMBER", "index": 176, "name": "PRCCSR_HEP013", "comment": null}, "PRCCSR_IMG001": {"type": "NUMBER", "index": 177, "name": "PRCCSR_IMG001", "comment": null}, "PRCCSR_IMG002": {"type": "NUMBER", "index": 178, "name": "PRCCSR_IMG002", "comment": null}, "PRCCSR_IMG003": {"type": "NUMBER", "index": 179, "name": "PRCCSR_IMG003", "comment": null}, "PRCCSR_IMG004": {"type": "NUMBER", "index": 180, "name": "PRCCSR_IMG004", "comment": null}, "PRCCSR_IMG005": {"type": "NUMBER", "index": 181, "name": "PRCCSR_IMG005", "comment": null}, "PRCCSR_IMG006": {"type": "NUMBER", "index": 182, "name": "PRCCSR_IMG006", "comment": null}, "PRCCSR_IMG007": {"type": "NUMBER", "index": 183, "name": "PRCCSR_IMG007", "comment": null}, "PRCCSR_IMG008": {"type": "NUMBER", "index": 184, "name": "PRCCSR_IMG008", "comment": null}, "PRCCSR_IMG009": {"type": "NUMBER", "index": 185, "name": "PRCCSR_IMG009", "comment": null}, "PRCCSR_IMG010": {"type": "NUMBER", "index": 186, "name": "PRCCSR_IMG010", "comment": null}, "PRCCSR_LYM001": {"type": "NUMBER", "index": 187, "name": "PRCCSR_LYM001", "comment": null}, "PRCCSR_LYM002": {"type": "NUMBER", "index": 188, "name": "PRCCSR_LYM002", "comment": null}, "PRCCSR_LYM003": {"type": "NUMBER", "index": 189, "name": "PRCCSR_LYM003", "comment": null}, "PRCCSR_LYM004": {"type": "NUMBER", "index": 190, "name": "PRCCSR_LYM004", "comment": null}, "PRCCSR_LYM005": {"type": "NUMBER", "index": 191, "name": "PRCCSR_LYM005", "comment": null}, "PRCCSR_LYM006": {"type": "NUMBER", "index": 192, "name": "PRCCSR_LYM006", "comment": null}, "PRCCSR_LYM007": {"type": "NUMBER", "index": 193, "name": "PRCCSR_LYM007", "comment": null}, "PRCCSR_LYM008": {"type": "NUMBER", "index": 194, "name": "PRCCSR_LYM008", "comment": null}, "PRCCSR_LYM009": {"type": "NUMBER", "index": 195, "name": "PRCCSR_LYM009", "comment": null}, "PRCCSR_LYM010": {"type": "NUMBER", "index": 196, "name": "PRCCSR_LYM010", "comment": null}, "PRCCSR_LYM011": {"type": "NUMBER", "index": 197, "name": "PRCCSR_LYM011", "comment": null}, "PRCCSR_MAM001": {"type": "NUMBER", "index": 198, "name": "PRCCSR_MAM001", "comment": null}, "PRCCSR_MAM002": {"type": "NUMBER", "index": 199, "name": "PRCCSR_MAM002", "comment": null}, "PRCCSR_MAM003": {"type": "NUMBER", "index": 200, "name": "PRCCSR_MAM003", "comment": null}, "PRCCSR_MAM004": {"type": "NUMBER", "index": 201, "name": "PRCCSR_MAM004", "comment": null}, "PRCCSR_MAM005": {"type": "NUMBER", "index": 202, "name": "PRCCSR_MAM005", "comment": null}, "PRCCSR_MAM006": {"type": "NUMBER", "index": 203, "name": "PRCCSR_MAM006", "comment": null}, "PRCCSR_MAM007": {"type": "NUMBER", "index": 204, "name": "PRCCSR_MAM007", "comment": null}, "PRCCSR_MAM008": {"type": "NUMBER", "index": 205, "name": "PRCCSR_MAM008", "comment": null}, "PRCCSR_MAM009": {"type": "NUMBER", "index": 206, "name": "PRCCSR_MAM009", "comment": null}, "PRCCSR_MAM010": {"type": "NUMBER", "index": 207, "name": "PRCCSR_MAM010", "comment": null}, "PRCCSR_MAM011": {"type": "NUMBER", "index": 208, "name": "PRCCSR_MAM011", "comment": null}, "PRCCSR_MAM012": {"type": "NUMBER", "index": 209, "name": "PRCCSR_MAM012", "comment": null}, "PRCCSR_MAM013": {"type": "NUMBER", "index": 210, "name": "PRCCSR_MAM013", "comment": null}, "PRCCSR_MAM014": {"type": "NUMBER", "index": 211, "name": "PRCCSR_MAM014", "comment": null}, "PRCCSR_MAM015": {"type": "NUMBER", "index": 212, "name": "PRCCSR_MAM015", "comment": null}, "PRCCSR_MHT001": {"type": "NUMBER", "index": 213, "name": "PRCCSR_MHT001", "comment": null}, "PRCCSR_MHT002": {"type": "NUMBER", "index": 214, "name": "PRCCSR_MHT002", "comment": null}, "PRCCSR_MHT003": {"type": "NUMBER", "index": 215, "name": "PRCCSR_MHT003", "comment": null}, "PRCCSR_MHT004": {"type": "NUMBER", "index": 216, "name": "PRCCSR_MHT004", "comment": null}, "PRCCSR_MHT005": {"type": "NUMBER", "index": 217, "name": "PRCCSR_MHT005", "comment": null}, "PRCCSR_MRS001": {"type": "NUMBER", "index": 218, "name": "PRCCSR_MRS001", "comment": null}, "PRCCSR_MRS002": {"type": "NUMBER", "index": 219, "name": "PRCCSR_MRS002", "comment": null}, "PRCCSR_MRS003": {"type": "NUMBER", "index": 220, "name": "PRCCSR_MRS003", "comment": null}, "PRCCSR_MRS004": {"type": "NUMBER", "index": 221, "name": "PRCCSR_MRS004", "comment": null}, "PRCCSR_MRS005": {"type": "NUMBER", "index": 222, "name": "PRCCSR_MRS005", "comment": null}, "PRCCSR_MRS006": {"type": "NUMBER", "index": 223, "name": "PRCCSR_MRS006", "comment": null}, "PRCCSR_MRS007": {"type": "NUMBER", "index": 224, "name": "PRCCSR_MRS007", "comment": null}, "PRCCSR_MST001": {"type": "NUMBER", "index": 225, "name": "PRCCSR_MST001", "comment": null}, "PRCCSR_MST002": {"type": "NUMBER", "index": 226, "name": "PRCCSR_MST002", "comment": null}, "PRCCSR_MST003": {"type": "NUMBER", "index": 227, "name": "PRCCSR_MST003", "comment": null}, "PRCCSR_MST004": {"type": "NUMBER", "index": 228, "name": "PRCCSR_MST004", "comment": null}, "PRCCSR_MST005": {"type": "NUMBER", "index": 229, "name": "PRCCSR_MST005", "comment": null}, "PRCCSR_MST006": {"type": "NUMBER", "index": 230, "name": "PRCCSR_MST006", "comment": null}, "PRCCSR_MST007": {"type": "NUMBER", "index": 231, "name": "PRCCSR_MST007", "comment": null}, "PRCCSR_MST008": {"type": "NUMBER", "index": 232, "name": "PRCCSR_MST008", "comment": null}, "PRCCSR_MST009": {"type": "NUMBER", "index": 233, "name": "PRCCSR_MST009", "comment": null}, "PRCCSR_MST010": {"type": "NUMBER", "index": 234, "name": "PRCCSR_MST010", "comment": null}, "PRCCSR_MST011": {"type": "NUMBER", "index": 235, "name": "PRCCSR_MST011", "comment": null}, "PRCCSR_MST012": {"type": "NUMBER", "index": 236, "name": "PRCCSR_MST012", "comment": null}, "PRCCSR_MST013": {"type": "NUMBER", "index": 237, "name": "PRCCSR_MST013", "comment": null}, "PRCCSR_MST014": {"type": "NUMBER", "index": 238, "name": "PRCCSR_MST014", "comment": null}, "PRCCSR_MST015": {"type": "NUMBER", "index": 239, "name": "PRCCSR_MST015", "comment": null}, "PRCCSR_MST016": {"type": "NUMBER", "index": 240, "name": "PRCCSR_MST016", "comment": null}, "PRCCSR_MST017": {"type": "NUMBER", "index": 241, "name": "PRCCSR_MST017", "comment": null}, "PRCCSR_MST018": {"type": "NUMBER", "index": 242, "name": "PRCCSR_MST018", "comment": null}, "PRCCSR_MST019": {"type": "NUMBER", "index": 243, "name": "PRCCSR_MST019", "comment": null}, "PRCCSR_MST020": {"type": "NUMBER", "index": 244, "name": "PRCCSR_MST020", "comment": null}, "PRCCSR_MST021": {"type": "NUMBER", "index": 245, "name": "PRCCSR_MST021", "comment": null}, "PRCCSR_MST022": {"type": "NUMBER", "index": 246, "name": "PRCCSR_MST022", "comment": null}, "PRCCSR_MST023": {"type": "NUMBER", "index": 247, "name": "PRCCSR_MST023", "comment": null}, "PRCCSR_MST024": {"type": "NUMBER", "index": 248, "name": "PRCCSR_MST024", "comment": null}, "PRCCSR_MST025": {"type": "NUMBER", "index": 249, "name": "PRCCSR_MST025", "comment": null}, "PRCCSR_MST026": {"type": "NUMBER", "index": 250, "name": "PRCCSR_MST026", "comment": null}, "PRCCSR_MST027": {"type": "NUMBER", "index": 251, "name": "PRCCSR_MST027", "comment": null}, "PRCCSR_MST028": {"type": "NUMBER", "index": 252, "name": "PRCCSR_MST028", "comment": null}, "PRCCSR_MST029": {"type": "NUMBER", "index": 253, "name": "PRCCSR_MST029", "comment": null}, "PRCCSR_MST030": {"type": "NUMBER", "index": 254, "name": "PRCCSR_MST030", "comment": null}, "PRCCSR_NCM001": {"type": "NUMBER", "index": 255, "name": "PRCCSR_NCM001", "comment": null}, "PRCCSR_NCM002": {"type": "NUMBER", "index": 256, "name": "PRCCSR_NCM002", "comment": null}, "PRCCSR_NCM003": {"type": "NUMBER", "index": 257, "name": "PRCCSR_NCM003", "comment": null}, "PRCCSR_NCM004": {"type": "NUMBER", "index": 258, "name": "PRCCSR_NCM004", "comment": null}, "PRCCSR_OST001": {"type": "NUMBER", "index": 259, "name": "PRCCSR_OST001", "comment": null}, "PRCCSR_OTR001": {"type": "NUMBER", "index": 260, "name": "PRCCSR_OTR001", "comment": null}, "PRCCSR_OTR002": {"type": "NUMBER", "index": 261, "name": "PRCCSR_OTR002", "comment": null}, "PRCCSR_OTR003": {"type": "NUMBER", "index": 262, "name": "PRCCSR_OTR003", "comment": null}, "PRCCSR_OTR004": {"type": "NUMBER", "index": 263, "name": "PRCCSR_OTR004", "comment": null}, "PRCCSR_OTR005": {"type": "NUMBER", "index": 264, "name": "PRCCSR_OTR005", "comment": null}, "PRCCSR_PGN001": {"type": "NUMBER", "index": 265, "name": "PRCCSR_PGN001", "comment": null}, "PRCCSR_PGN002": {"type": "NUMBER", "index": 266, "name": "PRCCSR_PGN002", "comment": null}, "PRCCSR_PGN003": {"type": "NUMBER", "index": 267, "name": "PRCCSR_PGN003", "comment": null}, "PRCCSR_PGN004": {"type": "NUMBER", "index": 268, "name": "PRCCSR_PGN004", "comment": null}, "PRCCSR_PGN005": {"type": "NUMBER", "index": 269, "name": "PRCCSR_PGN005", "comment": null}, "PRCCSR_PGN006": {"type": "NUMBER", "index": 270, "name": "PRCCSR_PGN006", "comment": null}, "PRCCSR_PGN007": {"type": "NUMBER", "index": 271, "name": "PRCCSR_PGN007", "comment": null}, "PRCCSR_PGN008": {"type": "NUMBER", "index": 272, "name": "PRCCSR_PGN008", "comment": null}, "PRCCSR_PGN009": {"type": "NUMBER", "index": 273, "name": "PRCCSR_PGN009", "comment": null}, "PRCCSR_PLC001": {"type": "NUMBER", "index": 274, "name": "PRCCSR_PLC001", "comment": null}, "PRCCSR_PLC002": {"type": "NUMBER", "index": 275, "name": "PRCCSR_PLC002", "comment": null}, "PRCCSR_PNS001": {"type": "NUMBER", "index": 276, "name": "PRCCSR_PNS001", "comment": null}, "PRCCSR_PNS002": {"type": "NUMBER", "index": 277, "name": "PRCCSR_PNS002", "comment": null}, "PRCCSR_PNS003": {"type": "NUMBER", "index": 278, "name": "PRCCSR_PNS003", "comment": null}, "PRCCSR_PNS004": {"type": "NUMBER", "index": 279, "name": "PRCCSR_PNS004", "comment": null}, "PRCCSR_PNS005": {"type": "NUMBER", "index": 280, "name": "PRCCSR_PNS005", "comment": null}, "PRCCSR_PNS006": {"type": "NUMBER", "index": 281, "name": "PRCCSR_PNS006", "comment": null}, "PRCCSR_RAD001": {"type": "NUMBER", "index": 282, "name": "PRCCSR_RAD001", "comment": null}, "PRCCSR_RAD002": {"type": "NUMBER", "index": 283, "name": "PRCCSR_RAD002", "comment": null}, "PRCCSR_RAD003": {"type": "NUMBER", "index": 284, "name": "PRCCSR_RAD003", "comment": null}, "PRCCSR_RAD004": {"type": "NUMBER", "index": 285, "name": "PRCCSR_RAD004", "comment": null}, "PRCCSR_RES001": {"type": "NUMBER", "index": 286, "name": "PRCCSR_RES001", "comment": null}, "PRCCSR_RES002": {"type": "NUMBER", "index": 287, "name": "PRCCSR_RES002", "comment": null}, "PRCCSR_RES003": {"type": "NUMBER", "index": 288, "name": "PRCCSR_RES003", "comment": null}, "PRCCSR_RES004": {"type": "NUMBER", "index": 289, "name": "PRCCSR_RES004", "comment": null}, "PRCCSR_RES005": {"type": "NUMBER", "index": 290, "name": "PRCCSR_RES005", "comment": null}, "PRCCSR_RES006": {"type": "NUMBER", "index": 291, "name": "PRCCSR_RES006", "comment": null}, "PRCCSR_RES007": {"type": "NUMBER", "index": 292, "name": "PRCCSR_RES007", "comment": null}, "PRCCSR_RES008": {"type": "NUMBER", "index": 293, "name": "PRCCSR_RES008", "comment": null}, "PRCCSR_RES009": {"type": "NUMBER", "index": 294, "name": "PRCCSR_RES009", "comment": null}, "PRCCSR_RES010": {"type": "NUMBER", "index": 295, "name": "PRCCSR_RES010", "comment": null}, "PRCCSR_RES011": {"type": "NUMBER", "index": 296, "name": "PRCCSR_RES011", "comment": null}, "PRCCSR_RES012": {"type": "NUMBER", "index": 297, "name": "PRCCSR_RES012", "comment": null}, "PRCCSR_RES013": {"type": "NUMBER", "index": 298, "name": "PRCCSR_RES013", "comment": null}, "PRCCSR_RES014": {"type": "NUMBER", "index": 299, "name": "PRCCSR_RES014", "comment": null}, "PRCCSR_RHB001": {"type": "NUMBER", "index": 300, "name": "PRCCSR_RHB001", "comment": null}, "PRCCSR_RHB002": {"type": "NUMBER", "index": 301, "name": "PRCCSR_RHB002", "comment": null}, "PRCCSR_RHB003": {"type": "NUMBER", "index": 302, "name": "PRCCSR_RHB003", "comment": null}, "PRCCSR_RHB004": {"type": "NUMBER", "index": 303, "name": "PRCCSR_RHB004", "comment": null}, "PRCCSR_SKB001": {"type": "NUMBER", "index": 304, "name": "PRCCSR_SKB001", "comment": null}, "PRCCSR_SKB002": {"type": "NUMBER", "index": 305, "name": "PRCCSR_SKB002", "comment": null}, "PRCCSR_SKB003": {"type": "NUMBER", "index": 306, "name": "PRCCSR_SKB003", "comment": null}, "PRCCSR_SKB004": {"type": "NUMBER", "index": 307, "name": "PRCCSR_SKB004", "comment": null}, "PRCCSR_SKB005": {"type": "NUMBER", "index": 308, "name": "PRCCSR_SKB005", "comment": null}, "PRCCSR_SKB006": {"type": "NUMBER", "index": 309, "name": "PRCCSR_SKB006", "comment": null}, "PRCCSR_SKB007": {"type": "NUMBER", "index": 310, "name": "PRCCSR_SKB007", "comment": null}, "PRCCSR_SKB008": {"type": "NUMBER", "index": 311, "name": "PRCCSR_SKB008", "comment": null}, "PRCCSR_SKB009": {"type": "NUMBER", "index": 312, "name": "PRCCSR_SKB009", "comment": null}, "PRCCSR_SKB010": {"type": "NUMBER", "index": 313, "name": "PRCCSR_SKB010", "comment": null}, "PRCCSR_SUD001": {"type": "NUMBER", "index": 314, "name": "PRCCSR_SUD001", "comment": null}, "PRCCSR_SUD002": {"type": "NUMBER", "index": 315, "name": "PRCCSR_SUD002", "comment": null}, "PRCCSR_SUD003": {"type": "NUMBER", "index": 316, "name": "PRCCSR_SUD003", "comment": null}, "PRCCSR_SUD004": {"type": "NUMBER", "index": 317, "name": "PRCCSR_SUD004", "comment": null}, "PRCCSR_URN001": {"type": "NUMBER", "index": 318, "name": "PRCCSR_URN001", "comment": null}, "PRCCSR_URN002": {"type": "NUMBER", "index": 319, "name": "PRCCSR_URN002", "comment": null}, "PRCCSR_URN003": {"type": "NUMBER", "index": 320, "name": "PRCCSR_URN003", "comment": null}, "PRCCSR_URN004": {"type": "NUMBER", "index": 321, "name": "PRCCSR_URN004", "comment": null}, "PRCCSR_URN005": {"type": "NUMBER", "index": 322, "name": "PRCCSR_URN005", "comment": null}, "PRCCSR_URN006": {"type": "NUMBER", "index": 323, "name": "PRCCSR_URN006", "comment": null}, "PRCCSR_URN007": {"type": "NUMBER", "index": 324, "name": "PRCCSR_URN007", "comment": null}, "PRCCSR_URN008": {"type": "NUMBER", "index": 325, "name": "PRCCSR_URN008", "comment": null}, "PRCCSR_URN009": {"type": "NUMBER", "index": 326, "name": "PRCCSR_URN009", "comment": null}, "PRCCSR_URN010": {"type": "NUMBER", "index": 327, "name": "PRCCSR_URN010", "comment": null}, "PRCCSR_URN011": {"type": "NUMBER", "index": 328, "name": "PRCCSR_URN011", "comment": null}, "PRCCSR_URN012": {"type": "NUMBER", "index": 329, "name": "PRCCSR_URN012", "comment": null}, "PRCCSR_VERSION": {"type": "TEXT", "index": 330, "name": "PRCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 331, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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__wide_procedure_category"}, "seed.claims_data_model.eligibility_seed": {"metadata": {"type": "BASE TABLE", "schema": "TUVA_SYNTHETIC", "name": "ELIGIBILITY_SEED", "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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "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": "2023-09-05 16: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": "seed.claims_data_model.eligibility_seed"}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RAW_RISK_SCORE": {"type": "NUMBER", "index": 2, "name": "RAW_RISK_SCORE", "comment": null}, "NORMALIZED_RISK_SCORE": {"type": "NUMBER", "index": 3, "name": "NORMALIZED_RISK_SCORE", "comment": null}, "PAYMENT_RISK_SCORE": {"type": "NUMBER", "index": 4, "name": "PAYMENT_RISK_SCORE", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.readmissions__diagnosis": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_STG_DIAGNOSIS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CODE": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CODE", "comment": null}, "DIAGNOSIS_RANK": {"type": "NUMBER", "index": 3, "name": "DIAGNOSIS_RANK", "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__diagnosis"}, "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PROF_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__medical_claim_prof_missing_values"}, "model.the_tuva_project.claims_date_profiling__duplicate_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DUPLICATE_DATES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_START_DATE": {"type": "NUMBER", "index": 1, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 2, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 3, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "MED_PAID_DATE": {"type": "NUMBER", "index": 5, "name": "MED_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 6, "name": "DISPENSING_DATE", "comment": null}, "RX_PAID_DATE": {"type": "NUMBER", "index": 7, "name": "RX_PAID_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": 1.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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__duplicate_dates"}, "model.the_tuva_project.ccsr__singular_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "SINGULAR_CONDITION_CATEGORY", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.terminology__fips_county": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "FIPS_COUNTY", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__fips_county"}, "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INST_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__medical_claim_inst_missing_values"}, "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": "TUVA", "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}, "INPATIENT_PAID": {"type": "FLOAT", "index": 3, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "FLOAT", "index": 4, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "FLOAT", "index": 5, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "FLOAT", "index": 6, "name": "ANCILLARY_PAID", "comment": null}, "OTHER_PAID": {"type": "FLOAT", "index": 7, "name": "OTHER_PAID", "comment": null}, "PHARMACY_PAID": {"type": "FLOAT", "index": 8, "name": "PHARMACY_PAID", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__discharge_disposition": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "DISCHARGE_DISPOSITION", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__discharge_disposition"}, "model.the_tuva_project.data_profiling__claim_type_mapping_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_MAPPING_FAILURES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__claim_type_mapping_failures"}, "seed.the_tuva_project.terminology__medicare_status": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_STATUS", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__medicare_status"}, "model.the_tuva_project.data_profiling__eligibility_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__eligibility_missing_values"}, "model.the_tuva_project.service_category__hospice_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__emergency_department_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__home_health_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.quality_measures_reporting__summary_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "SUMMARY_LONG", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 6, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 7, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 8, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 10, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 11, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 12, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__summary_long"}, "model.claims_data_model.pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 14, "name": "ALLOWED_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "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.claims_data_model.pharmacy_claim"}, "seed.the_tuva_project.terminology__claim_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CLAIM_TYPE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__claim_type"}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PREP", "database": "TUVA", "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}, "INPATIENT_PAID": {"type": "FLOAT", "index": 3, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "FLOAT", "index": 4, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "FLOAT", "index": 5, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "FLOAT", "index": 6, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "FLOAT", "index": 7, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "FLOAT", "index": 8, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "FLOAT", "index": 9, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "FLOAT", "index": 10, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "FLOAT", "index": 11, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "FLOAT", "index": 12, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "FLOAT", "index": 13, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "FLOAT", "index": 14, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "FLOAT", "index": 15, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "FLOAT", "index": 16, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "FLOAT", "index": 17, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "FLOAT", "index": 18, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "FLOAT", "index": 19, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "FLOAT", "index": 20, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "FLOAT", "index": 21, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "FLOAT", "index": 22, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "FLOAT", "index": 23, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "FLOAT", "index": 24, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "FLOAT", "index": 25, "name": "URGENT_CARE_PAID", "comment": null}, "INPATIENT_ALLOWED": {"type": "FLOAT", "index": 26, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "FLOAT", "index": 27, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "FLOAT", "index": 28, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "FLOAT", "index": 29, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "FLOAT", "index": 30, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "FLOAT", "index": 31, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "FLOAT", "index": 32, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "FLOAT", "index": 33, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "FLOAT", "index": 34, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "FLOAT", "index": 35, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "FLOAT", "index": 36, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "FLOAT", "index": 37, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "FLOAT", "index": 38, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "FLOAT", "index": 39, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "FLOAT", "index": 40, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "FLOAT", "index": 41, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "FLOAT", "index": 42, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "FLOAT", "index": 43, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "FLOAT", "index": 44, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "FLOAT", "index": 45, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "FLOAT", "index": 46, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "FLOAT", "index": 47, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "FLOAT", "index": 48, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TOTAL_PAID": {"type": "FLOAT", "index": 49, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "FLOAT", "index": 50, "name": "MEDICAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "FLOAT", "index": 51, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "FLOAT", "index": 52, "name": "MEDICAL_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 53, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__dialysis_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_DATES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 2, "name": "DISPENSING_DATE", "comment": null}, "PAID_DATE": {"type": "NUMBER", "index": 3, "name": "PAID_DATE", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__pharmacy_claim_dates"}, "model.the_tuva_project.core__stg_clinical_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "TEXT", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "TEXT", "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": "TEXT", "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": "TEXT", "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.quality_measures_reporting__int_nqf2372_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_NUMERATOR", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_numerator"}, "seed.the_tuva_project.terminology__present_on_admission": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PRESENT_ON_ADMISSION", "database": "TUVA", "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": "2023-09-05 17:00UTC", "include": true, "description": "The timestamp for last update/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.readmissions__index_time_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_TIME_REQUIREMENT", "database": "TUVA", "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"}, "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES_SNAPSHOT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RAW_RISK_SCORE": {"type": "NUMBER", "index": 2, "name": "RAW_RISK_SCORE", "comment": null}, "NORMALIZED_RISK_SCORE": {"type": "NUMBER", "index": 3, "name": "NORMALIZED_RISK_SCORE", "comment": null}, "PAYMENT_RISK_SCORE": {"type": "NUMBER", "index": 4, "name": "PAYMENT_RISK_SCORE", "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}, "DBT_SCD_ID": {"type": "TEXT", "index": 8, "name": "DBT_SCD_ID", "comment": null}, "DBT_UPDATED_AT": {"type": "TEXT", "index": 9, "name": "DBT_UPDATED_AT", "comment": null}, "DBT_VALID_FROM": {"type": "TEXT", "index": 10, "name": "DBT_VALID_FROM", "comment": null}, "DBT_VALID_TO": {"type": "TEXT", "index": 11, "name": "DBT_VALID_TO", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 40960.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 15:42UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot"}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ELIGIBLE_CONDITIONS", "database": "TUVA", "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}, "MODEL_VERSION": {"type": "TEXT", "index": 3, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 4, "name": "PAYMENT_YEAR", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__eligibility_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DENOMINATORS", "database": "TUVA", "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": 6.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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__eligibility_denominators"}, "model.the_tuva_project.readmissions__primary_diagnosis_count": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PRIMARY_DIAGNOSIS_COUNT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PRIMARY_DX_COUNT": {"type": "NUMBER", "index": 2, "name": "PRIMARY_DX_COUNT", "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__primary_diagnosis_count"}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_FACTORS", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.cms_hcc__disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_FACTORS", "database": "TUVA", "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": 580.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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__disease_factors"}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_LONG", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 6, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 7, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 8, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 10, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 11, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 12, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_long"}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__bill_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "BILL_TYPE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__bill_type"}, "model.the_tuva_project.core__stg_claims_eligibility": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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_claims_eligibility"}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_INTERACTION_FACTORS", "database": "TUVA", "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": 223.0, "include": true, "description": "An approximate count of rows in this table"}, "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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, "model.the_tuva_project.service_category__home_health_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_medical_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 11, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 12, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 13, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 14, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 17, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 18, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 19, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 20, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 21, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 22, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 23, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 24, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 30, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 31, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 32, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 33, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 34, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 35, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "CHARGE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 37, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 38, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 39, "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_claims_medical_claim"}, "model.the_tuva_project.ccsr__long_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_CONDITION_CATEGORY", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__hospice_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__acute_inpatient_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__medical_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DUPLICATES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__medical_claim_duplicates"}, "model.the_tuva_project.core__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 14, "name": "ALLOWED_AMOUNT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.quality_measures_reporting__int_nqf2372_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "_INT_NQF2372_EXCLUSIONS", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 9, "name": "EXCLUSION_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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__int_nqf2372_exclusions"}, "model.the_tuva_project.data_profiling__use_case": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "USE_CASE", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__use_case"}, "model.the_tuva_project.service_category__lab_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__claims_without_enrollment": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "CLAIMS_WITHOUT_ENROLLMENT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DESCRIPTION": {"type": "TEXT", "index": 1, "name": "TEST_DESCRIPTION", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "CLAIM_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": 2.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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__claims_without_enrollment"}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAIL_DETAILS", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__institutional_header_fail_details"}, "seed.the_tuva_project.terminology__encounter_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ENCOUNTER_TYPE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__encounter_type"}, "model.the_tuva_project.readmissions__readmission_summary": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "READMISSION_SUMMARY", "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}, "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}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "TOTAL_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": "2023-09-05 20:36UTC", "include": true, "description": "The timestamp for last update/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__lab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.acute_inpatient__claims_with_encounter_data": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_CLAIMS_WITH_ENCOUNTER_DATA", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.core__stg_clinical_observation": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "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": "TEXT", "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.readmissions__icd_10_pcs_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_PCS_TO_CCS", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, "model.the_tuva_project.core__stg_claims_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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": "TEXT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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_claims_location"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__icd_9_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_CM", "database": "TUVA", "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": 14568.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 393728.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.terminology__icd_9_cm"}, "model.claims_data_model.procedure": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "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": "TEXT", "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.claims_data_model.procedure"}, "model.the_tuva_project.readmissions__encounter_augmented": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "ENCOUNTER_AUGMENTED", "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}, "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}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "TOTAL_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}, "MULTIPLE_PRIMARY_DIAGNOSES_FLAG": {"type": "NUMBER", "index": 22, "name": "MULTIPLE_PRIMARY_DIAGNOSES_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 23, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 24, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 25, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 26, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 27, "name": "INVALID_MS_DRG_FLAG", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.cms_hcc__disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISABLED_INTERACTION_FACTORS", "database": "TUVA", "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": 8.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": "2023-09-05 16: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": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, "model.the_tuva_project.core__observation": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "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": "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__date_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "DATE_SUMMARY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 2, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 4, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 5, "name": "DISCHARGE_DATE", "comment": null}, "MEDICAL_PAID_DATE": {"type": "NUMBER", "index": 6, "name": "MEDICAL_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "RX_PAID_DATE": {"type": "NUMBER", "index": 8, "name": "RX_PAID_DATE", "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": 1.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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__date_summary"}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_MEDICAL_CLAIM", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_result_stage_medical_claim"}, "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_PHARMACY_CLAIM", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__test_detail_stage_pharmacy_claim"}, "model.the_tuva_project.readmissions__procedure_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PROCEDURE_CCS", "database": "TUVA", "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"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.core__lab_result": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "TEXT", "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": "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.acute_inpatient__encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_START_AND_END_DATES", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.service_category__service_category_grouper": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SERVICE_CATEGORY_GROUPER", "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}, "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.quality_measures_reporting__summary_wide": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES_REPORTING", "name": "SUMMARY_WIDE", "database": "TUVA", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_reporting__summary_wide"}, "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS_SNAPSHOT", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 6, "name": "COEFFICIENT", "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}, "DBT_SCD_ID": {"type": "TEXT", "index": 10, "name": "DBT_SCD_ID", "comment": null}, "DBT_UPDATED_AT": {"type": "TEXT", "index": 11, "name": "DBT_UPDATED_AT", "comment": null}, "DBT_VALID_FROM": {"type": "TEXT", "index": 12, "name": "DBT_VALID_FROM", "comment": null}, "DBT_VALID_TO": {"type": "TEXT", "index": 13, "name": "DBT_VALID_TO", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "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": "2023-09-05 15:42UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot"}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DEMOGRAPHIC_FACTORS", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 12, "name": "COEFFICIENT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 13, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 14, "name": "PAYMENT_YEAR", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.service_category__outpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PLAUSIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 6, "name": "CLAIM_ID", "comment": null}, "COUNTS": {"type": "NUMBER", "index": 7, "name": "COUNTS", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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_profiling__medical_claim_plausibility"}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL_ENCOUNTER_ID", "database": "TUVA", "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}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 6, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 7, "name": "ENCOUNTER_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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_PCS", "database": "TUVA", "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": 78603.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1000960.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16: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": "seed.the_tuva_project.terminology__icd_10_pcs"}, "model.the_tuva_project.ccsr__long_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_PROCEDURE_CATEGORY", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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__place_of_service": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PLACE_OF_SERVICE", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__place_of_service"}, "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": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, "seed.the_tuva_project.service_category__service_categories": {"metadata": {"type": "BASE TABLE", "schema": "SERVICE_CATEGORY", "name": "_VALUE_SET_SERVICE_CATEGORIES", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.service_category__service_categories"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_WIDE", "database": "TUVA", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.core__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__medical_claim_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DATES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 2, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 4, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 5, "name": "DISCHARGE_DATE", "comment": null}, "PAID_DATE": {"type": "NUMBER", "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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.claims_date_profiling__medical_claim_dates"}, "model.the_tuva_project.service_category__combined_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_PROFESSIONAL", "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}, "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": "2023-09-05 20:35UTC", "include": true, "description": "The timestamp for last update/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"}, "model.claims_data_model.patient": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "TEXT", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "TEXT", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "TEXT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "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.claims_data_model.patient"}, "seed.the_tuva_project.terminology__provider": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PROVIDER", "database": "TUVA", "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": 7944248.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 244508160.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-05 16:57UTC", "include": true, "description": "The timestamp for last update/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.claims_data_model.location": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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.claims_data_model.location"}, "seed.the_tuva_project.terminology__ethnicity": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ETHNICITY", "database": "TUVA", "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": "2023-09-05 16: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": "seed.the_tuva_project.terminology__ethnicity"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.4.5", "generated_at": "2023-09-12T13:16:00.810740Z", "invocation_id": "d3420436-3f9f-40f8-9264-25572b056af6", "env": {}}, "nodes": {"model.the_tuva_project.core__location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.terminology__encounter_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ENCOUNTER_TYPE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.readmissions__encounter_augmented": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "ENCOUNTER_AUGMENTED", "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}, "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}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "TOTAL_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}, "MULTIPLE_PRIMARY_DIAGNOSES_FLAG": {"type": "NUMBER", "index": 22, "name": "MULTIPLE_PRIMARY_DIAGNOSES_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 23, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 24, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 25, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 26, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 27, "name": "INVALID_MS_DRG_FLAG", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PREP", "database": "TUVA", "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}, "INPATIENT_PAID": {"type": "NUMBER", "index": 3, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 4, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 5, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 6, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 7, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 8, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 9, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 10, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 11, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 12, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 13, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 14, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 15, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 16, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 17, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 18, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 19, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 20, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 21, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 22, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 23, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 24, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 25, "name": "URGENT_CARE_PAID", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 26, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 27, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 28, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 29, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 30, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 31, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 32, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 33, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 34, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 35, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 36, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 37, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 38, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 39, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 40, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 41, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 42, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 43, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 44, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 45, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 46, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 47, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 48, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 49, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 50, "name": "MEDICAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 51, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 52, "name": "MEDICAL_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 53, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__combined_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.quality_measures__summary_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_LONG", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 6, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 7, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 8, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 10, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 11, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 12, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.financial_pmpm__pmpm": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 2, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 4, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 5, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 7, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 8, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 9, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 10, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 11, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 12, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 13, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 14, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 15, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 16, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 17, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 18, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 19, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 20, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 21, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 22, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 23, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 24, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 25, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 26, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 27, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 28, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 29, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 30, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 31, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 32, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 33, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 34, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 35, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 36, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 37, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 38, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 39, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 40, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 41, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 42, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 43, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 44, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 45, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 46, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 47, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 48, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 49, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 50, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 51, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 52, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 53, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.readmissions__index_admission": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_ADMISSION", "database": "TUVA", "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.data_profiling__institutional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAILURES", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 138, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__institutional_header_failures"}, "model.the_tuva_project.core__stg_claims_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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_claims_procedure"}, "model.the_tuva_project.ccsr__long_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_CONDITION_CATEGORY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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__claim_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CLAIM_TYPE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.service_category__skilled_nursing_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__medical_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DUPLICATES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__medical_claim_duplicates"}, "seed.the_tuva_project.terminology__bill_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "BILL_TYPE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 22016.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.claims_data_model.pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 14, "name": "ALLOWED_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "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.claims_data_model.pharmacy_claim"}, "model.the_tuva_project.service_category__hospice_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.quality_measures__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CODES", "database": "TUVA", "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": 4101.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 44032.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.acute_inpatient__encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_START_AND_END_DATES", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_nqf2372_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_LONG", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 6, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 7, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 8, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 10, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 11, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 12, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.core__stg_claims_eligibility": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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_claims_eligibility"}, "model.the_tuva_project.service_category__lab_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.cms_hcc__disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_FACTORS", "database": "TUVA", "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": 580.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 13312.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.data_profiling__eligibility_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DENOMINATORS", "database": "TUVA", "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": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__eligibility_denominators"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_WIDE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.readmissions__readmission_summary": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "READMISSION_SUMMARY", "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}, "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}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "TOTAL_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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_data_model.location": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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.claims_data_model.location"}, "model.the_tuva_project.core__stg_clinical_observation": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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.terminology__fips_county": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "FIPS_COUNTY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 31232.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.service_category__hospice_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__eligibility_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__eligibility_missing_values"}, "model.the_tuva_project.claims_date_profiling__medical_claim_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DATES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 2, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 4, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 5, "name": "DISCHARGE_DATE", "comment": null}, "PAID_DATE": {"type": "NUMBER", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.claims_date_profiling__medical_claim_dates"}, "seed.the_tuva_project.terminology__icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_PCS", "database": "TUVA", "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": 78603.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1000960.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1899008.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.chronic_conditions__tuva_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_LONG", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION_FAMILY": {"type": "TEXT", "index": 2, "name": "CONDITION_FAMILY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 3, "name": "CONDITION", "comment": null}, "FIRST_DIAGNOSIS_DATE": {"type": "DATE", "index": 4, "name": "FIRST_DIAGNOSIS_DATE", "comment": null}, "LAST_DIAGNOSIS_DATE": {"type": "DATE", "index": 5, "name": "LAST_DIAGNOSIS_DATE", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.quality_measures__int_nqf2372_exclude_mastectomy": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_MASTECTOMY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__int_demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DEMOGRAPHIC_FACTORS", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 12, "name": "COEFFICIENT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 13, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 14, "name": "PAYMENT_YEAR", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_data_model.procedure": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "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": "TEXT", "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.claims_data_model.procedure"}, "model.the_tuva_project.readmissions__index_time_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_TIME_REQUIREMENT", "database": "TUVA", "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"}, "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS_SNAPSHOT", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 6, "name": "COEFFICIENT", "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}, "DBT_SCD_ID": {"type": "TEXT", "index": 10, "name": "DBT_SCD_ID", "comment": null}, "DBT_UPDATED_AT": {"type": "TEXT", "index": 11, "name": "DBT_UPDATED_AT", "comment": null}, "DBT_VALID_FROM": {"type": "TEXT", "index": 12, "name": "DBT_VALID_FROM", "comment": null}, "DBT_VALID_TO": {"type": "TEXT", "index": 13, "name": "DBT_VALID_TO", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 46592.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot"}, "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "CLAIMS_WITHOUT_ENROLLMENT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DESCRIPTION": {"type": "TEXT", "index": 1, "name": "TEST_DESCRIPTION", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "CLAIM_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": 2.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.claims_date_profiling__claims_without_enrollment"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 183808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_INTERACTION_FACTORS", "database": "TUVA", "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": 223.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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_profiling__institutional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAIL_DETAILS", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__institutional_header_fail_details"}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_FACTORS", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.acute_inpatient__encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_ID", "database": "TUVA", "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}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "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.acute_inpatient__encounter_id"}, "seed.the_tuva_project.terminology__calendar": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CALENDAR", "database": "TUVA", "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}, "DATE": {"type": "NUMBER", "index": 4, "name": "DATE", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 882176.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.claims_data_model.medical_claim": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "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.claims_data_model.medical_claim"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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__code_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CODE_TYPE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.quality_measures__int_nqf2372_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_NUMERATOR", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__patient_risk_scores": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RAW_RISK_SCORE": {"type": "NUMBER", "index": 2, "name": "RAW_RISK_SCORE", "comment": null}, "NORMALIZED_RISK_SCORE": {"type": "NUMBER", "index": 3, "name": "NORMALIZED_RISK_SCORE", "comment": null}, "PAYMENT_RISK_SCORE": {"type": "NUMBER", "index": 4, "name": "PAYMENT_RISK_SCORE", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__int_hcc_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_HIERARCHY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_data_model.pharmacy_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "TUVA_SYNTHETIC", "name": "PHARMACY_CLAIM_SEED", "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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 14, "name": "ALLOWED_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.claims_data_model.pharmacy_claim_seed"}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SURGERY_GYNECOLOGY_COHORT", "database": "TUVA", "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": 1676.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 28672.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.data_profiling__eligibility_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DUPLICATES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__eligibility_duplicates"}, "seed.the_tuva_project.quality_measures__concepts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CONCEPTS", "database": "TUVA", "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": 36.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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__admit_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_TYPE", "database": "TUVA", "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": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.terminology__icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_CM", "database": "TUVA", "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": 74044.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1063936.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.core__stg_claims_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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_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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__acute_inpatient_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__use_case": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "USE_CASE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__use_case"}, "seed.the_tuva_project.terminology__ansi_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ANSI_FIPS_STATE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.service_category__dialysis_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__pharmacy_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_DUPLICATES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__pharmacy_claim_duplicates"}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_REHAB_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__test_result_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_PHARMACY_CLAIM", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_result_stage_pharmacy_claim"}, "model.the_tuva_project.core__stg_clinical_lab_result": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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"}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "OTHER_PROVIDER_TAXONOMY", "database": "TUVA", "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": 9254795.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 67061248.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.financial_pmpm__service_category_2_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_PAID_PIVOT", "database": "TUVA", "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}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 3, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 4, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 5, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 6, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 7, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 8, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 9, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 10, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 11, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 12, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 13, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 14, "name": "OFFICE_VISIT_PAID", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 15, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 16, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 17, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 18, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 19, "name": "URGENT_CARE_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SUMMARY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__summary"}, "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": "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.quality_measures__int_nqf2372_exclude_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_DEMENTIA", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_dementia"}, "model.the_tuva_project.data_profiling__medical_claim_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DENOMINATORS", "database": "TUVA", "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": 14.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__medical_claim_denominators"}, "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": "TUVA", "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.cms_hcc__int_hcc_mapping": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_MAPPING", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.ccsr__wide_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "WIDE_CONDITION_CATEGORY", "database": "TUVA", "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}, "DXCCSR_BLD001": {"type": "NUMBER", "index": 4, "name": "DXCCSR_BLD001", "comment": null}, "DXCCSR_BLD002": {"type": "NUMBER", "index": 5, "name": "DXCCSR_BLD002", "comment": null}, "DXCCSR_BLD003": {"type": "NUMBER", "index": 6, "name": "DXCCSR_BLD003", "comment": null}, "DXCCSR_BLD004": {"type": "NUMBER", "index": 7, "name": "DXCCSR_BLD004", "comment": null}, "DXCCSR_BLD005": {"type": "NUMBER", "index": 8, "name": "DXCCSR_BLD005", "comment": null}, "DXCCSR_BLD006": {"type": "NUMBER", "index": 9, "name": "DXCCSR_BLD006", "comment": null}, "DXCCSR_BLD007": {"type": "NUMBER", "index": 10, "name": "DXCCSR_BLD007", "comment": null}, "DXCCSR_BLD008": {"type": "NUMBER", "index": 11, "name": "DXCCSR_BLD008", "comment": null}, "DXCCSR_BLD009": {"type": "NUMBER", "index": 12, "name": "DXCCSR_BLD009", "comment": null}, "DXCCSR_BLD010": {"type": "NUMBER", "index": 13, "name": "DXCCSR_BLD010", "comment": null}, "DXCCSR_CIR001": {"type": "NUMBER", "index": 14, "name": "DXCCSR_CIR001", "comment": null}, "DXCCSR_CIR002": {"type": "NUMBER", "index": 15, "name": "DXCCSR_CIR002", "comment": null}, "DXCCSR_CIR003": {"type": "NUMBER", "index": 16, "name": "DXCCSR_CIR003", "comment": null}, "DXCCSR_CIR004": {"type": "NUMBER", "index": 17, "name": "DXCCSR_CIR004", "comment": null}, "DXCCSR_CIR005": {"type": "NUMBER", "index": 18, "name": "DXCCSR_CIR005", "comment": null}, "DXCCSR_CIR006": {"type": "NUMBER", "index": 19, "name": "DXCCSR_CIR006", "comment": null}, "DXCCSR_CIR007": {"type": "NUMBER", "index": 20, "name": "DXCCSR_CIR007", "comment": null}, "DXCCSR_CIR008": {"type": "NUMBER", "index": 21, "name": "DXCCSR_CIR008", "comment": null}, "DXCCSR_CIR009": {"type": "NUMBER", "index": 22, "name": "DXCCSR_CIR009", "comment": null}, "DXCCSR_CIR010": {"type": "NUMBER", "index": 23, "name": "DXCCSR_CIR010", "comment": null}, "DXCCSR_CIR011": {"type": "NUMBER", "index": 24, "name": "DXCCSR_CIR011", "comment": null}, "DXCCSR_CIR012": {"type": "NUMBER", "index": 25, "name": "DXCCSR_CIR012", "comment": null}, "DXCCSR_CIR013": {"type": "NUMBER", "index": 26, "name": "DXCCSR_CIR013", "comment": null}, "DXCCSR_CIR014": {"type": "NUMBER", "index": 27, "name": "DXCCSR_CIR014", "comment": null}, "DXCCSR_CIR015": {"type": "NUMBER", "index": 28, "name": "DXCCSR_CIR015", "comment": null}, "DXCCSR_CIR016": {"type": "NUMBER", "index": 29, "name": "DXCCSR_CIR016", "comment": null}, "DXCCSR_CIR017": {"type": "NUMBER", "index": 30, "name": "DXCCSR_CIR017", "comment": null}, "DXCCSR_CIR018": {"type": "NUMBER", "index": 31, "name": "DXCCSR_CIR018", "comment": null}, "DXCCSR_CIR019": {"type": "NUMBER", "index": 32, "name": "DXCCSR_CIR019", "comment": null}, "DXCCSR_CIR020": {"type": "NUMBER", "index": 33, "name": "DXCCSR_CIR020", "comment": null}, "DXCCSR_CIR021": {"type": "NUMBER", "index": 34, "name": "DXCCSR_CIR021", "comment": null}, "DXCCSR_CIR022": {"type": "NUMBER", "index": 35, "name": "DXCCSR_CIR022", "comment": null}, "DXCCSR_CIR023": {"type": "NUMBER", "index": 36, "name": "DXCCSR_CIR023", "comment": null}, "DXCCSR_CIR024": {"type": "NUMBER", "index": 37, "name": "DXCCSR_CIR024", "comment": null}, "DXCCSR_CIR025": {"type": "NUMBER", "index": 38, "name": "DXCCSR_CIR025", "comment": null}, "DXCCSR_CIR026": {"type": "NUMBER", "index": 39, "name": "DXCCSR_CIR026", "comment": null}, "DXCCSR_CIR027": {"type": "NUMBER", "index": 40, "name": "DXCCSR_CIR027", "comment": null}, "DXCCSR_CIR028": {"type": "NUMBER", "index": 41, "name": "DXCCSR_CIR028", "comment": null}, "DXCCSR_CIR029": {"type": "NUMBER", "index": 42, "name": "DXCCSR_CIR029", "comment": null}, "DXCCSR_CIR030": {"type": "NUMBER", "index": 43, "name": "DXCCSR_CIR030", "comment": null}, "DXCCSR_CIR031": {"type": "NUMBER", "index": 44, "name": "DXCCSR_CIR031", "comment": null}, "DXCCSR_CIR032": {"type": "NUMBER", "index": 45, "name": "DXCCSR_CIR032", "comment": null}, "DXCCSR_CIR033": {"type": "NUMBER", "index": 46, "name": "DXCCSR_CIR033", "comment": null}, "DXCCSR_CIR034": {"type": "NUMBER", "index": 47, "name": "DXCCSR_CIR034", "comment": null}, "DXCCSR_CIR035": {"type": "NUMBER", "index": 48, "name": "DXCCSR_CIR035", "comment": null}, "DXCCSR_CIR036": {"type": "NUMBER", "index": 49, "name": "DXCCSR_CIR036", "comment": null}, "DXCCSR_CIR037": {"type": "NUMBER", "index": 50, "name": "DXCCSR_CIR037", "comment": null}, "DXCCSR_CIR038": {"type": "NUMBER", "index": 51, "name": "DXCCSR_CIR038", "comment": null}, "DXCCSR_CIR039": {"type": "NUMBER", "index": 52, "name": "DXCCSR_CIR039", "comment": null}, "DXCCSR_DEN001": {"type": "NUMBER", "index": 53, "name": "DXCCSR_DEN001", "comment": null}, "DXCCSR_DEN002": {"type": "NUMBER", "index": 54, "name": "DXCCSR_DEN002", "comment": null}, "DXCCSR_DEN003": {"type": "NUMBER", "index": 55, "name": "DXCCSR_DEN003", "comment": null}, "DXCCSR_DIG001": {"type": "NUMBER", "index": 56, "name": "DXCCSR_DIG001", "comment": null}, "DXCCSR_DIG002": {"type": "NUMBER", "index": 57, "name": "DXCCSR_DIG002", "comment": null}, "DXCCSR_DIG003": {"type": "NUMBER", "index": 58, "name": "DXCCSR_DIG003", "comment": null}, "DXCCSR_DIG004": {"type": "NUMBER", "index": 59, "name": "DXCCSR_DIG004", "comment": null}, "DXCCSR_DIG005": {"type": "NUMBER", "index": 60, "name": "DXCCSR_DIG005", "comment": null}, "DXCCSR_DIG006": {"type": "NUMBER", "index": 61, "name": "DXCCSR_DIG006", "comment": null}, "DXCCSR_DIG007": {"type": "NUMBER", "index": 62, "name": "DXCCSR_DIG007", "comment": null}, "DXCCSR_DIG008": {"type": "NUMBER", "index": 63, "name": "DXCCSR_DIG008", "comment": null}, "DXCCSR_DIG009": {"type": "NUMBER", "index": 64, "name": "DXCCSR_DIG009", "comment": null}, "DXCCSR_DIG010": {"type": "NUMBER", "index": 65, "name": "DXCCSR_DIG010", "comment": null}, "DXCCSR_DIG011": {"type": "NUMBER", "index": 66, "name": "DXCCSR_DIG011", "comment": null}, "DXCCSR_DIG012": {"type": "NUMBER", "index": 67, "name": "DXCCSR_DIG012", "comment": null}, "DXCCSR_DIG013": {"type": "NUMBER", "index": 68, "name": "DXCCSR_DIG013", "comment": null}, "DXCCSR_DIG014": {"type": "NUMBER", "index": 69, "name": "DXCCSR_DIG014", "comment": null}, "DXCCSR_DIG015": {"type": "NUMBER", "index": 70, "name": "DXCCSR_DIG015", "comment": null}, "DXCCSR_DIG016": {"type": "NUMBER", "index": 71, "name": "DXCCSR_DIG016", "comment": null}, "DXCCSR_DIG017": {"type": "NUMBER", "index": 72, "name": "DXCCSR_DIG017", "comment": null}, "DXCCSR_DIG018": {"type": "NUMBER", "index": 73, "name": "DXCCSR_DIG018", "comment": null}, "DXCCSR_DIG019": {"type": "NUMBER", "index": 74, "name": "DXCCSR_DIG019", "comment": null}, "DXCCSR_DIG020": {"type": "NUMBER", "index": 75, "name": "DXCCSR_DIG020", "comment": null}, "DXCCSR_DIG021": {"type": "NUMBER", "index": 76, "name": "DXCCSR_DIG021", "comment": null}, "DXCCSR_DIG022": {"type": "NUMBER", "index": 77, "name": "DXCCSR_DIG022", "comment": null}, "DXCCSR_DIG023": {"type": "NUMBER", "index": 78, "name": "DXCCSR_DIG023", "comment": null}, "DXCCSR_DIG024": {"type": "NUMBER", "index": 79, "name": "DXCCSR_DIG024", "comment": null}, "DXCCSR_DIG025": {"type": "NUMBER", "index": 80, "name": "DXCCSR_DIG025", "comment": null}, "DXCCSR_EAR001": {"type": "NUMBER", "index": 81, "name": "DXCCSR_EAR001", "comment": null}, "DXCCSR_EAR002": {"type": "NUMBER", "index": 82, "name": "DXCCSR_EAR002", "comment": null}, "DXCCSR_EAR003": {"type": "NUMBER", "index": 83, "name": "DXCCSR_EAR003", "comment": null}, "DXCCSR_EAR004": {"type": "NUMBER", "index": 84, "name": "DXCCSR_EAR004", "comment": null}, "DXCCSR_EAR005": {"type": "NUMBER", "index": 85, "name": "DXCCSR_EAR005", "comment": null}, "DXCCSR_EAR006": {"type": "NUMBER", "index": 86, "name": "DXCCSR_EAR006", "comment": null}, "DXCCSR_END001": {"type": "NUMBER", "index": 87, "name": "DXCCSR_END001", "comment": null}, "DXCCSR_END002": {"type": "NUMBER", "index": 88, "name": "DXCCSR_END002", "comment": null}, "DXCCSR_END003": {"type": "NUMBER", "index": 89, "name": "DXCCSR_END003", "comment": null}, "DXCCSR_END004": {"type": "NUMBER", "index": 90, "name": "DXCCSR_END004", "comment": null}, "DXCCSR_END005": {"type": "NUMBER", "index": 91, "name": "DXCCSR_END005", "comment": null}, "DXCCSR_END006": {"type": "NUMBER", "index": 92, "name": "DXCCSR_END006", "comment": null}, "DXCCSR_END007": {"type": "NUMBER", "index": 93, "name": "DXCCSR_END007", "comment": null}, "DXCCSR_END008": {"type": "NUMBER", "index": 94, "name": "DXCCSR_END008", "comment": null}, "DXCCSR_END009": {"type": "NUMBER", "index": 95, "name": "DXCCSR_END009", "comment": null}, "DXCCSR_END010": {"type": "NUMBER", "index": 96, "name": "DXCCSR_END010", "comment": null}, "DXCCSR_END011": {"type": "NUMBER", "index": 97, "name": "DXCCSR_END011", "comment": null}, "DXCCSR_END012": {"type": "NUMBER", "index": 98, "name": "DXCCSR_END012", "comment": null}, "DXCCSR_END013": {"type": "NUMBER", "index": 99, "name": "DXCCSR_END013", "comment": null}, "DXCCSR_END014": {"type": "NUMBER", "index": 100, "name": "DXCCSR_END014", "comment": null}, "DXCCSR_END015": {"type": "NUMBER", "index": 101, "name": "DXCCSR_END015", "comment": null}, "DXCCSR_END016": {"type": "NUMBER", "index": 102, "name": "DXCCSR_END016", "comment": null}, "DXCCSR_END017": {"type": "NUMBER", "index": 103, "name": "DXCCSR_END017", "comment": null}, "DXCCSR_EXT001": {"type": "NUMBER", "index": 104, "name": "DXCCSR_EXT001", "comment": null}, "DXCCSR_EXT002": {"type": "NUMBER", "index": 105, "name": "DXCCSR_EXT002", "comment": null}, "DXCCSR_EXT003": {"type": "NUMBER", "index": 106, "name": "DXCCSR_EXT003", "comment": null}, "DXCCSR_EXT004": {"type": "NUMBER", "index": 107, "name": "DXCCSR_EXT004", "comment": null}, "DXCCSR_EXT005": {"type": "NUMBER", "index": 108, "name": "DXCCSR_EXT005", "comment": null}, "DXCCSR_EXT006": {"type": "NUMBER", "index": 109, "name": "DXCCSR_EXT006", "comment": null}, "DXCCSR_EXT007": {"type": "NUMBER", "index": 110, "name": "DXCCSR_EXT007", "comment": null}, "DXCCSR_EXT008": {"type": "NUMBER", "index": 111, "name": "DXCCSR_EXT008", "comment": null}, "DXCCSR_EXT009": {"type": "NUMBER", "index": 112, "name": "DXCCSR_EXT009", "comment": null}, "DXCCSR_EXT010": {"type": "NUMBER", "index": 113, "name": "DXCCSR_EXT010", "comment": null}, "DXCCSR_EXT011": {"type": "NUMBER", "index": 114, "name": "DXCCSR_EXT011", "comment": null}, "DXCCSR_EXT012": {"type": "NUMBER", "index": 115, "name": "DXCCSR_EXT012", "comment": null}, "DXCCSR_EXT013": {"type": "NUMBER", "index": 116, "name": "DXCCSR_EXT013", "comment": null}, "DXCCSR_EXT014": {"type": "NUMBER", "index": 117, "name": "DXCCSR_EXT014", "comment": null}, "DXCCSR_EXT015": {"type": "NUMBER", "index": 118, "name": "DXCCSR_EXT015", "comment": null}, "DXCCSR_EXT016": {"type": "NUMBER", "index": 119, "name": "DXCCSR_EXT016", "comment": null}, "DXCCSR_EXT017": {"type": "NUMBER", "index": 120, "name": "DXCCSR_EXT017", "comment": null}, "DXCCSR_EXT018": {"type": "NUMBER", "index": 121, "name": "DXCCSR_EXT018", "comment": null}, "DXCCSR_EXT019": {"type": "NUMBER", "index": 122, "name": "DXCCSR_EXT019", "comment": null}, "DXCCSR_EXT020": {"type": "NUMBER", "index": 123, "name": "DXCCSR_EXT020", "comment": null}, "DXCCSR_EXT021": {"type": "NUMBER", "index": 124, "name": "DXCCSR_EXT021", "comment": null}, "DXCCSR_EXT022": {"type": "NUMBER", "index": 125, "name": "DXCCSR_EXT022", "comment": null}, "DXCCSR_EXT023": {"type": "NUMBER", "index": 126, "name": "DXCCSR_EXT023", "comment": null}, "DXCCSR_EXT024": {"type": "NUMBER", "index": 127, "name": "DXCCSR_EXT024", "comment": null}, "DXCCSR_EXT025": {"type": "NUMBER", "index": 128, "name": "DXCCSR_EXT025", "comment": null}, "DXCCSR_EXT026": {"type": "NUMBER", "index": 129, "name": "DXCCSR_EXT026", "comment": null}, "DXCCSR_EXT027": {"type": "NUMBER", "index": 130, "name": "DXCCSR_EXT027", "comment": null}, "DXCCSR_EXT028": {"type": "NUMBER", "index": 131, "name": "DXCCSR_EXT028", "comment": null}, "DXCCSR_EXT029": {"type": "NUMBER", "index": 132, "name": "DXCCSR_EXT029", "comment": null}, "DXCCSR_EXT030": {"type": "NUMBER", "index": 133, "name": "DXCCSR_EXT030", "comment": null}, "DXCCSR_EYE001": {"type": "NUMBER", "index": 134, "name": "DXCCSR_EYE001", "comment": null}, "DXCCSR_EYE002": {"type": "NUMBER", "index": 135, "name": "DXCCSR_EYE002", "comment": null}, "DXCCSR_EYE003": {"type": "NUMBER", "index": 136, "name": "DXCCSR_EYE003", "comment": null}, "DXCCSR_EYE004": {"type": "NUMBER", "index": 137, "name": "DXCCSR_EYE004", "comment": null}, "DXCCSR_EYE005": {"type": "NUMBER", "index": 138, "name": "DXCCSR_EYE005", "comment": null}, "DXCCSR_EYE006": {"type": "NUMBER", "index": 139, "name": "DXCCSR_EYE006", "comment": null}, "DXCCSR_EYE007": {"type": "NUMBER", "index": 140, "name": "DXCCSR_EYE007", "comment": null}, "DXCCSR_EYE008": {"type": "NUMBER", "index": 141, "name": "DXCCSR_EYE008", "comment": null}, "DXCCSR_EYE009": {"type": "NUMBER", "index": 142, "name": "DXCCSR_EYE009", "comment": null}, "DXCCSR_EYE010": {"type": "NUMBER", "index": 143, "name": "DXCCSR_EYE010", "comment": null}, "DXCCSR_EYE011": {"type": "NUMBER", "index": 144, "name": "DXCCSR_EYE011", "comment": null}, "DXCCSR_EYE012": {"type": "NUMBER", "index": 145, "name": "DXCCSR_EYE012", "comment": null}, "DXCCSR_FAC001": {"type": "NUMBER", "index": 146, "name": "DXCCSR_FAC001", "comment": null}, "DXCCSR_FAC002": {"type": "NUMBER", "index": 147, "name": "DXCCSR_FAC002", "comment": null}, "DXCCSR_FAC003": {"type": "NUMBER", "index": 148, "name": "DXCCSR_FAC003", "comment": null}, "DXCCSR_FAC004": {"type": "NUMBER", "index": 149, "name": "DXCCSR_FAC004", "comment": null}, "DXCCSR_FAC005": {"type": "NUMBER", "index": 150, "name": "DXCCSR_FAC005", "comment": null}, "DXCCSR_FAC006": {"type": "NUMBER", "index": 151, "name": "DXCCSR_FAC006", "comment": null}, "DXCCSR_FAC007": {"type": "NUMBER", "index": 152, "name": "DXCCSR_FAC007", "comment": null}, "DXCCSR_FAC008": {"type": "NUMBER", "index": 153, "name": "DXCCSR_FAC008", "comment": null}, "DXCCSR_FAC009": {"type": "NUMBER", "index": 154, "name": "DXCCSR_FAC009", "comment": null}, "DXCCSR_FAC010": {"type": "NUMBER", "index": 155, "name": "DXCCSR_FAC010", "comment": null}, "DXCCSR_FAC011": {"type": "NUMBER", "index": 156, "name": "DXCCSR_FAC011", "comment": null}, "DXCCSR_FAC012": {"type": "NUMBER", "index": 157, "name": "DXCCSR_FAC012", "comment": null}, "DXCCSR_FAC013": {"type": "NUMBER", "index": 158, "name": "DXCCSR_FAC013", "comment": null}, "DXCCSR_FAC014": {"type": "NUMBER", "index": 159, "name": "DXCCSR_FAC014", "comment": null}, "DXCCSR_FAC015": {"type": "NUMBER", "index": 160, "name": "DXCCSR_FAC015", "comment": null}, "DXCCSR_FAC016": {"type": "NUMBER", "index": 161, "name": "DXCCSR_FAC016", "comment": null}, "DXCCSR_FAC017": {"type": "NUMBER", "index": 162, "name": "DXCCSR_FAC017", "comment": null}, "DXCCSR_FAC018": {"type": "NUMBER", "index": 163, "name": "DXCCSR_FAC018", "comment": null}, "DXCCSR_FAC019": {"type": "NUMBER", "index": 164, "name": "DXCCSR_FAC019", "comment": null}, "DXCCSR_FAC020": {"type": "NUMBER", "index": 165, "name": "DXCCSR_FAC020", "comment": null}, "DXCCSR_FAC021": {"type": "NUMBER", "index": 166, "name": "DXCCSR_FAC021", "comment": null}, "DXCCSR_FAC022": {"type": "NUMBER", "index": 167, "name": "DXCCSR_FAC022", "comment": null}, "DXCCSR_FAC023": {"type": "NUMBER", "index": 168, "name": "DXCCSR_FAC023", "comment": null}, "DXCCSR_FAC024": {"type": "NUMBER", "index": 169, "name": "DXCCSR_FAC024", "comment": null}, "DXCCSR_FAC025": {"type": "NUMBER", "index": 170, "name": "DXCCSR_FAC025", "comment": null}, "DXCCSR_GEN001": {"type": "NUMBER", "index": 171, "name": "DXCCSR_GEN001", "comment": null}, "DXCCSR_GEN002": {"type": "NUMBER", "index": 172, "name": "DXCCSR_GEN002", "comment": null}, "DXCCSR_GEN003": {"type": "NUMBER", "index": 173, "name": "DXCCSR_GEN003", "comment": null}, "DXCCSR_GEN004": {"type": "NUMBER", "index": 174, "name": "DXCCSR_GEN004", "comment": null}, "DXCCSR_GEN005": {"type": "NUMBER", "index": 175, "name": "DXCCSR_GEN005", "comment": null}, "DXCCSR_GEN006": {"type": "NUMBER", "index": 176, "name": "DXCCSR_GEN006", "comment": null}, "DXCCSR_GEN007": {"type": "NUMBER", "index": 177, "name": "DXCCSR_GEN007", "comment": null}, "DXCCSR_GEN008": {"type": "NUMBER", "index": 178, "name": "DXCCSR_GEN008", "comment": null}, "DXCCSR_GEN009": {"type": "NUMBER", "index": 179, "name": "DXCCSR_GEN009", "comment": null}, "DXCCSR_GEN010": {"type": "NUMBER", "index": 180, "name": "DXCCSR_GEN010", "comment": null}, "DXCCSR_GEN011": {"type": "NUMBER", "index": 181, "name": "DXCCSR_GEN011", "comment": null}, "DXCCSR_GEN012": {"type": "NUMBER", "index": 182, "name": "DXCCSR_GEN012", "comment": null}, "DXCCSR_GEN013": {"type": "NUMBER", "index": 183, "name": "DXCCSR_GEN013", "comment": null}, "DXCCSR_GEN014": {"type": "NUMBER", "index": 184, "name": "DXCCSR_GEN014", "comment": null}, "DXCCSR_GEN015": {"type": "NUMBER", "index": 185, "name": "DXCCSR_GEN015", "comment": null}, "DXCCSR_GEN016": {"type": "NUMBER", "index": 186, "name": "DXCCSR_GEN016", "comment": null}, "DXCCSR_GEN017": {"type": "NUMBER", "index": 187, "name": "DXCCSR_GEN017", "comment": null}, "DXCCSR_GEN018": {"type": "NUMBER", "index": 188, "name": "DXCCSR_GEN018", "comment": null}, "DXCCSR_GEN019": {"type": "NUMBER", "index": 189, "name": "DXCCSR_GEN019", "comment": null}, "DXCCSR_GEN020": {"type": "NUMBER", "index": 190, "name": "DXCCSR_GEN020", "comment": null}, "DXCCSR_GEN021": {"type": "NUMBER", "index": 191, "name": "DXCCSR_GEN021", "comment": null}, "DXCCSR_GEN022": {"type": "NUMBER", "index": 192, "name": "DXCCSR_GEN022", "comment": null}, "DXCCSR_GEN023": {"type": "NUMBER", "index": 193, "name": "DXCCSR_GEN023", "comment": null}, "DXCCSR_GEN024": {"type": "NUMBER", "index": 194, "name": "DXCCSR_GEN024", "comment": null}, "DXCCSR_GEN025": {"type": "NUMBER", "index": 195, "name": "DXCCSR_GEN025", "comment": null}, "DXCCSR_GEN026": {"type": "NUMBER", "index": 196, "name": "DXCCSR_GEN026", "comment": null}, "DXCCSR_INF001": {"type": "NUMBER", "index": 197, "name": "DXCCSR_INF001", "comment": null}, "DXCCSR_INF002": {"type": "NUMBER", "index": 198, "name": "DXCCSR_INF002", "comment": null}, "DXCCSR_INF003": {"type": "NUMBER", "index": 199, "name": "DXCCSR_INF003", "comment": null}, "DXCCSR_INF004": {"type": "NUMBER", "index": 200, "name": "DXCCSR_INF004", "comment": null}, "DXCCSR_INF005": {"type": "NUMBER", "index": 201, "name": "DXCCSR_INF005", "comment": null}, "DXCCSR_INF006": {"type": "NUMBER", "index": 202, "name": "DXCCSR_INF006", "comment": null}, "DXCCSR_INF007": {"type": "NUMBER", "index": 203, "name": "DXCCSR_INF007", "comment": null}, "DXCCSR_INF008": {"type": "NUMBER", "index": 204, "name": "DXCCSR_INF008", "comment": null}, "DXCCSR_INF009": {"type": "NUMBER", "index": 205, "name": "DXCCSR_INF009", "comment": null}, "DXCCSR_INF010": {"type": "NUMBER", "index": 206, "name": "DXCCSR_INF010", "comment": null}, "DXCCSR_INF011": {"type": "NUMBER", "index": 207, "name": "DXCCSR_INF011", "comment": null}, "DXCCSR_INF012": {"type": "NUMBER", "index": 208, "name": "DXCCSR_INF012", "comment": null}, "DXCCSR_INJ001": {"type": "NUMBER", "index": 209, "name": "DXCCSR_INJ001", "comment": null}, "DXCCSR_INJ002": {"type": "NUMBER", "index": 210, "name": "DXCCSR_INJ002", "comment": null}, "DXCCSR_INJ003": {"type": "NUMBER", "index": 211, "name": "DXCCSR_INJ003", "comment": null}, "DXCCSR_INJ004": {"type": "NUMBER", "index": 212, "name": "DXCCSR_INJ004", "comment": null}, "DXCCSR_INJ005": {"type": "NUMBER", "index": 213, "name": "DXCCSR_INJ005", "comment": null}, "DXCCSR_INJ006": {"type": "NUMBER", "index": 214, "name": "DXCCSR_INJ006", "comment": null}, "DXCCSR_INJ007": {"type": "NUMBER", "index": 215, "name": "DXCCSR_INJ007", "comment": null}, "DXCCSR_INJ008": {"type": "NUMBER", "index": 216, "name": "DXCCSR_INJ008", "comment": null}, "DXCCSR_INJ009": {"type": "NUMBER", "index": 217, "name": "DXCCSR_INJ009", "comment": null}, "DXCCSR_INJ010": {"type": "NUMBER", "index": 218, "name": "DXCCSR_INJ010", "comment": null}, "DXCCSR_INJ011": {"type": "NUMBER", "index": 219, "name": "DXCCSR_INJ011", "comment": null}, "DXCCSR_INJ012": {"type": "NUMBER", "index": 220, "name": "DXCCSR_INJ012", "comment": null}, "DXCCSR_INJ013": {"type": "NUMBER", "index": 221, "name": "DXCCSR_INJ013", "comment": null}, "DXCCSR_INJ014": {"type": "NUMBER", "index": 222, "name": "DXCCSR_INJ014", "comment": null}, "DXCCSR_INJ015": {"type": "NUMBER", "index": 223, "name": "DXCCSR_INJ015", "comment": null}, "DXCCSR_INJ016": {"type": "NUMBER", "index": 224, "name": "DXCCSR_INJ016", "comment": null}, "DXCCSR_INJ017": {"type": "NUMBER", "index": 225, "name": "DXCCSR_INJ017", "comment": null}, "DXCCSR_INJ018": {"type": "NUMBER", "index": 226, "name": "DXCCSR_INJ018", "comment": null}, "DXCCSR_INJ019": {"type": "NUMBER", "index": 227, "name": "DXCCSR_INJ019", "comment": null}, "DXCCSR_INJ020": {"type": "NUMBER", "index": 228, "name": "DXCCSR_INJ020", "comment": null}, "DXCCSR_INJ021": {"type": "NUMBER", "index": 229, "name": "DXCCSR_INJ021", "comment": null}, "DXCCSR_INJ022": {"type": "NUMBER", "index": 230, "name": "DXCCSR_INJ022", "comment": null}, "DXCCSR_INJ023": {"type": "NUMBER", "index": 231, "name": "DXCCSR_INJ023", "comment": null}, "DXCCSR_INJ024": {"type": "NUMBER", "index": 232, "name": "DXCCSR_INJ024", "comment": null}, "DXCCSR_INJ025": {"type": "NUMBER", "index": 233, "name": "DXCCSR_INJ025", "comment": null}, "DXCCSR_INJ026": {"type": "NUMBER", "index": 234, "name": "DXCCSR_INJ026", "comment": null}, "DXCCSR_INJ027": {"type": "NUMBER", "index": 235, "name": "DXCCSR_INJ027", "comment": null}, "DXCCSR_INJ028": {"type": "NUMBER", "index": 236, "name": "DXCCSR_INJ028", "comment": null}, "DXCCSR_INJ029": {"type": "NUMBER", "index": 237, "name": "DXCCSR_INJ029", "comment": null}, "DXCCSR_INJ030": {"type": "NUMBER", "index": 238, "name": "DXCCSR_INJ030", "comment": null}, "DXCCSR_INJ031": {"type": "NUMBER", "index": 239, "name": "DXCCSR_INJ031", "comment": null}, "DXCCSR_INJ032": {"type": "NUMBER", "index": 240, "name": "DXCCSR_INJ032", "comment": null}, "DXCCSR_INJ033": {"type": "NUMBER", "index": 241, "name": "DXCCSR_INJ033", "comment": null}, "DXCCSR_INJ034": {"type": "NUMBER", "index": 242, "name": "DXCCSR_INJ034", "comment": null}, "DXCCSR_INJ035": {"type": "NUMBER", "index": 243, "name": "DXCCSR_INJ035", "comment": null}, "DXCCSR_INJ036": {"type": "NUMBER", "index": 244, "name": "DXCCSR_INJ036", "comment": null}, "DXCCSR_INJ037": {"type": "NUMBER", "index": 245, "name": "DXCCSR_INJ037", "comment": null}, "DXCCSR_INJ038": {"type": "NUMBER", "index": 246, "name": "DXCCSR_INJ038", "comment": null}, "DXCCSR_INJ039": {"type": "NUMBER", "index": 247, "name": "DXCCSR_INJ039", "comment": null}, "DXCCSR_INJ040": {"type": "NUMBER", "index": 248, "name": "DXCCSR_INJ040", "comment": null}, "DXCCSR_INJ041": {"type": "NUMBER", "index": 249, "name": "DXCCSR_INJ041", "comment": null}, "DXCCSR_INJ042": {"type": "NUMBER", "index": 250, "name": "DXCCSR_INJ042", "comment": null}, "DXCCSR_INJ043": {"type": "NUMBER", "index": 251, "name": "DXCCSR_INJ043", "comment": null}, "DXCCSR_INJ044": {"type": "NUMBER", "index": 252, "name": "DXCCSR_INJ044", "comment": null}, "DXCCSR_INJ045": {"type": "NUMBER", "index": 253, "name": "DXCCSR_INJ045", "comment": null}, "DXCCSR_INJ046": {"type": "NUMBER", "index": 254, "name": "DXCCSR_INJ046", "comment": null}, "DXCCSR_INJ047": {"type": "NUMBER", "index": 255, "name": "DXCCSR_INJ047", "comment": null}, "DXCCSR_INJ048": {"type": "NUMBER", "index": 256, "name": "DXCCSR_INJ048", "comment": null}, "DXCCSR_INJ049": {"type": "NUMBER", "index": 257, "name": "DXCCSR_INJ049", "comment": null}, "DXCCSR_INJ050": {"type": "NUMBER", "index": 258, "name": "DXCCSR_INJ050", "comment": null}, "DXCCSR_INJ051": {"type": "NUMBER", "index": 259, "name": "DXCCSR_INJ051", "comment": null}, "DXCCSR_INJ052": {"type": "NUMBER", "index": 260, "name": "DXCCSR_INJ052", "comment": null}, "DXCCSR_INJ053": {"type": "NUMBER", "index": 261, "name": "DXCCSR_INJ053", "comment": null}, "DXCCSR_INJ054": {"type": "NUMBER", "index": 262, "name": "DXCCSR_INJ054", "comment": null}, "DXCCSR_INJ055": {"type": "NUMBER", "index": 263, "name": "DXCCSR_INJ055", "comment": null}, "DXCCSR_INJ056": {"type": "NUMBER", "index": 264, "name": "DXCCSR_INJ056", "comment": null}, "DXCCSR_INJ057": {"type": "NUMBER", "index": 265, "name": "DXCCSR_INJ057", "comment": null}, "DXCCSR_INJ058": {"type": "NUMBER", "index": 266, "name": "DXCCSR_INJ058", "comment": null}, "DXCCSR_INJ059": {"type": "NUMBER", "index": 267, "name": "DXCCSR_INJ059", "comment": null}, "DXCCSR_INJ060": {"type": "NUMBER", "index": 268, "name": "DXCCSR_INJ060", "comment": null}, "DXCCSR_INJ061": {"type": "NUMBER", "index": 269, "name": "DXCCSR_INJ061", "comment": null}, "DXCCSR_INJ062": {"type": "NUMBER", "index": 270, "name": "DXCCSR_INJ062", "comment": null}, "DXCCSR_INJ063": {"type": "NUMBER", "index": 271, "name": "DXCCSR_INJ063", "comment": null}, "DXCCSR_INJ064": {"type": "NUMBER", "index": 272, "name": "DXCCSR_INJ064", "comment": null}, "DXCCSR_INJ065": {"type": "NUMBER", "index": 273, "name": "DXCCSR_INJ065", "comment": null}, "DXCCSR_INJ066": {"type": "NUMBER", "index": 274, "name": "DXCCSR_INJ066", "comment": null}, "DXCCSR_INJ067": {"type": "NUMBER", "index": 275, "name": "DXCCSR_INJ067", "comment": null}, "DXCCSR_INJ068": {"type": "NUMBER", "index": 276, "name": "DXCCSR_INJ068", "comment": null}, "DXCCSR_INJ069": {"type": "NUMBER", "index": 277, "name": "DXCCSR_INJ069", "comment": null}, "DXCCSR_INJ070": {"type": "NUMBER", "index": 278, "name": "DXCCSR_INJ070", "comment": null}, "DXCCSR_INJ071": {"type": "NUMBER", "index": 279, "name": "DXCCSR_INJ071", "comment": null}, "DXCCSR_INJ072": {"type": "NUMBER", "index": 280, "name": "DXCCSR_INJ072", "comment": null}, "DXCCSR_INJ073": {"type": "NUMBER", "index": 281, "name": "DXCCSR_INJ073", "comment": null}, "DXCCSR_INJ074": {"type": "NUMBER", "index": 282, "name": "DXCCSR_INJ074", "comment": null}, "DXCCSR_INJ075": {"type": "NUMBER", "index": 283, "name": "DXCCSR_INJ075", "comment": null}, "DXCCSR_INJ076": {"type": "NUMBER", "index": 284, "name": "DXCCSR_INJ076", "comment": null}, "DXCCSR_MAL001": {"type": "NUMBER", "index": 285, "name": "DXCCSR_MAL001", "comment": null}, "DXCCSR_MAL002": {"type": "NUMBER", "index": 286, "name": "DXCCSR_MAL002", "comment": null}, "DXCCSR_MAL003": {"type": "NUMBER", "index": 287, "name": "DXCCSR_MAL003", "comment": null}, "DXCCSR_MAL004": {"type": "NUMBER", "index": 288, "name": "DXCCSR_MAL004", "comment": null}, "DXCCSR_MAL005": {"type": "NUMBER", "index": 289, "name": "DXCCSR_MAL005", "comment": null}, "DXCCSR_MAL006": {"type": "NUMBER", "index": 290, "name": "DXCCSR_MAL006", "comment": null}, "DXCCSR_MAL007": {"type": "NUMBER", "index": 291, "name": "DXCCSR_MAL007", "comment": null}, "DXCCSR_MAL008": {"type": "NUMBER", "index": 292, "name": "DXCCSR_MAL008", "comment": null}, "DXCCSR_MAL009": {"type": "NUMBER", "index": 293, "name": "DXCCSR_MAL009", "comment": null}, "DXCCSR_MAL010": {"type": "NUMBER", "index": 294, "name": "DXCCSR_MAL010", "comment": null}, "DXCCSR_MBD001": {"type": "NUMBER", "index": 295, "name": "DXCCSR_MBD001", "comment": null}, "DXCCSR_MBD002": {"type": "NUMBER", "index": 296, "name": "DXCCSR_MBD002", "comment": null}, "DXCCSR_MBD003": {"type": "NUMBER", "index": 297, "name": "DXCCSR_MBD003", "comment": null}, "DXCCSR_MBD004": {"type": "NUMBER", "index": 298, "name": "DXCCSR_MBD004", "comment": null}, "DXCCSR_MBD005": {"type": "NUMBER", "index": 299, "name": "DXCCSR_MBD005", "comment": null}, "DXCCSR_MBD006": {"type": "NUMBER", "index": 300, "name": "DXCCSR_MBD006", "comment": null}, "DXCCSR_MBD007": {"type": "NUMBER", "index": 301, "name": "DXCCSR_MBD007", "comment": null}, "DXCCSR_MBD008": {"type": "NUMBER", "index": 302, "name": "DXCCSR_MBD008", "comment": null}, "DXCCSR_MBD009": {"type": "NUMBER", "index": 303, "name": "DXCCSR_MBD009", "comment": null}, "DXCCSR_MBD010": {"type": "NUMBER", "index": 304, "name": "DXCCSR_MBD010", "comment": null}, "DXCCSR_MBD011": {"type": "NUMBER", "index": 305, "name": "DXCCSR_MBD011", "comment": null}, "DXCCSR_MBD012": {"type": "NUMBER", "index": 306, "name": "DXCCSR_MBD012", "comment": null}, "DXCCSR_MBD013": {"type": "NUMBER", "index": 307, "name": "DXCCSR_MBD013", "comment": null}, "DXCCSR_MBD014": {"type": "NUMBER", "index": 308, "name": "DXCCSR_MBD014", "comment": null}, "DXCCSR_MBD017": {"type": "NUMBER", "index": 309, "name": "DXCCSR_MBD017", "comment": null}, "DXCCSR_MBD018": {"type": "NUMBER", "index": 310, "name": "DXCCSR_MBD018", "comment": null}, "DXCCSR_MBD019": {"type": "NUMBER", "index": 311, "name": "DXCCSR_MBD019", "comment": null}, "DXCCSR_MBD020": {"type": "NUMBER", "index": 312, "name": "DXCCSR_MBD020", "comment": null}, "DXCCSR_MBD021": {"type": "NUMBER", "index": 313, "name": "DXCCSR_MBD021", "comment": null}, "DXCCSR_MBD022": {"type": "NUMBER", "index": 314, "name": "DXCCSR_MBD022", "comment": null}, "DXCCSR_MBD023": {"type": "NUMBER", "index": 315, "name": "DXCCSR_MBD023", "comment": null}, "DXCCSR_MBD024": {"type": "NUMBER", "index": 316, "name": "DXCCSR_MBD024", "comment": null}, "DXCCSR_MBD025": {"type": "NUMBER", "index": 317, "name": "DXCCSR_MBD025", "comment": null}, "DXCCSR_MBD026": {"type": "NUMBER", "index": 318, "name": "DXCCSR_MBD026", "comment": null}, "DXCCSR_MBD027": {"type": "NUMBER", "index": 319, "name": "DXCCSR_MBD027", "comment": null}, "DXCCSR_MBD028": {"type": "NUMBER", "index": 320, "name": "DXCCSR_MBD028", "comment": null}, "DXCCSR_MBD029": {"type": "NUMBER", "index": 321, "name": "DXCCSR_MBD029", "comment": null}, "DXCCSR_MBD030": {"type": "NUMBER", "index": 322, "name": "DXCCSR_MBD030", "comment": null}, "DXCCSR_MBD031": {"type": "NUMBER", "index": 323, "name": "DXCCSR_MBD031", "comment": null}, "DXCCSR_MBD032": {"type": "NUMBER", "index": 324, "name": "DXCCSR_MBD032", "comment": null}, "DXCCSR_MBD033": {"type": "NUMBER", "index": 325, "name": "DXCCSR_MBD033", "comment": null}, "DXCCSR_MBD034": {"type": "NUMBER", "index": 326, "name": "DXCCSR_MBD034", "comment": null}, "DXCCSR_MUS001": {"type": "NUMBER", "index": 327, "name": "DXCCSR_MUS001", "comment": null}, "DXCCSR_MUS002": {"type": "NUMBER", "index": 328, "name": "DXCCSR_MUS002", "comment": null}, "DXCCSR_MUS003": {"type": "NUMBER", "index": 329, "name": "DXCCSR_MUS003", "comment": null}, "DXCCSR_MUS004": {"type": "NUMBER", "index": 330, "name": "DXCCSR_MUS004", "comment": null}, "DXCCSR_MUS005": {"type": "NUMBER", "index": 331, "name": "DXCCSR_MUS005", "comment": null}, "DXCCSR_MUS006": {"type": "NUMBER", "index": 332, "name": "DXCCSR_MUS006", "comment": null}, "DXCCSR_MUS007": {"type": "NUMBER", "index": 333, "name": "DXCCSR_MUS007", "comment": null}, "DXCCSR_MUS008": {"type": "NUMBER", "index": 334, "name": "DXCCSR_MUS008", "comment": null}, "DXCCSR_MUS009": {"type": "NUMBER", "index": 335, "name": "DXCCSR_MUS009", "comment": null}, "DXCCSR_MUS010": {"type": "NUMBER", "index": 336, "name": "DXCCSR_MUS010", "comment": null}, "DXCCSR_MUS011": {"type": "NUMBER", "index": 337, "name": "DXCCSR_MUS011", "comment": null}, "DXCCSR_MUS012": {"type": "NUMBER", "index": 338, "name": "DXCCSR_MUS012", "comment": null}, "DXCCSR_MUS013": {"type": "NUMBER", "index": 339, "name": "DXCCSR_MUS013", "comment": null}, "DXCCSR_MUS014": {"type": "NUMBER", "index": 340, "name": "DXCCSR_MUS014", "comment": null}, "DXCCSR_MUS015": {"type": "NUMBER", "index": 341, "name": "DXCCSR_MUS015", "comment": null}, "DXCCSR_MUS016": {"type": "NUMBER", "index": 342, "name": "DXCCSR_MUS016", "comment": null}, "DXCCSR_MUS017": {"type": "NUMBER", "index": 343, "name": "DXCCSR_MUS017", "comment": null}, "DXCCSR_MUS018": {"type": "NUMBER", "index": 344, "name": "DXCCSR_MUS018", "comment": null}, "DXCCSR_MUS019": {"type": "NUMBER", "index": 345, "name": "DXCCSR_MUS019", "comment": null}, "DXCCSR_MUS020": {"type": "NUMBER", "index": 346, "name": "DXCCSR_MUS020", "comment": null}, "DXCCSR_MUS021": {"type": "NUMBER", "index": 347, "name": "DXCCSR_MUS021", "comment": null}, "DXCCSR_MUS022": {"type": "NUMBER", "index": 348, "name": "DXCCSR_MUS022", "comment": null}, "DXCCSR_MUS023": {"type": "NUMBER", "index": 349, "name": "DXCCSR_MUS023", "comment": null}, "DXCCSR_MUS024": {"type": "NUMBER", "index": 350, "name": "DXCCSR_MUS024", "comment": null}, "DXCCSR_MUS025": {"type": "NUMBER", "index": 351, "name": "DXCCSR_MUS025", "comment": null}, "DXCCSR_MUS026": {"type": "NUMBER", "index": 352, "name": "DXCCSR_MUS026", "comment": null}, "DXCCSR_MUS027": {"type": "NUMBER", "index": 353, "name": "DXCCSR_MUS027", "comment": null}, "DXCCSR_MUS028": {"type": "NUMBER", "index": 354, "name": "DXCCSR_MUS028", "comment": null}, "DXCCSR_MUS029": {"type": "NUMBER", "index": 355, "name": "DXCCSR_MUS029", "comment": null}, "DXCCSR_MUS030": {"type": "NUMBER", "index": 356, "name": "DXCCSR_MUS030", "comment": null}, "DXCCSR_MUS031": {"type": "NUMBER", "index": 357, "name": "DXCCSR_MUS031", "comment": null}, "DXCCSR_MUS032": {"type": "NUMBER", "index": 358, "name": "DXCCSR_MUS032", "comment": null}, "DXCCSR_MUS033": {"type": "NUMBER", "index": 359, "name": "DXCCSR_MUS033", "comment": null}, "DXCCSR_MUS034": {"type": "NUMBER", "index": 360, "name": "DXCCSR_MUS034", "comment": null}, "DXCCSR_MUS035": {"type": "NUMBER", "index": 361, "name": "DXCCSR_MUS035", "comment": null}, "DXCCSR_MUS036": {"type": "NUMBER", "index": 362, "name": "DXCCSR_MUS036", "comment": null}, "DXCCSR_MUS037": {"type": "NUMBER", "index": 363, "name": "DXCCSR_MUS037", "comment": null}, "DXCCSR_MUS038": {"type": "NUMBER", "index": 364, "name": "DXCCSR_MUS038", "comment": null}, "DXCCSR_NEO001": {"type": "NUMBER", "index": 365, "name": "DXCCSR_NEO001", "comment": null}, "DXCCSR_NEO002": {"type": "NUMBER", "index": 366, "name": "DXCCSR_NEO002", "comment": null}, "DXCCSR_NEO003": {"type": "NUMBER", "index": 367, "name": "DXCCSR_NEO003", "comment": null}, "DXCCSR_NEO004": {"type": "NUMBER", "index": 368, "name": "DXCCSR_NEO004", "comment": null}, "DXCCSR_NEO005": {"type": "NUMBER", "index": 369, "name": "DXCCSR_NEO005", "comment": null}, "DXCCSR_NEO006": {"type": "NUMBER", "index": 370, "name": "DXCCSR_NEO006", "comment": null}, "DXCCSR_NEO007": {"type": "NUMBER", "index": 371, "name": "DXCCSR_NEO007", "comment": null}, "DXCCSR_NEO008": {"type": "NUMBER", "index": 372, "name": "DXCCSR_NEO008", "comment": null}, "DXCCSR_NEO009": {"type": "NUMBER", "index": 373, "name": "DXCCSR_NEO009", "comment": null}, "DXCCSR_NEO010": {"type": "NUMBER", "index": 374, "name": "DXCCSR_NEO010", "comment": null}, "DXCCSR_NEO011": {"type": "NUMBER", "index": 375, "name": "DXCCSR_NEO011", "comment": null}, "DXCCSR_NEO012": {"type": "NUMBER", "index": 376, "name": "DXCCSR_NEO012", "comment": null}, "DXCCSR_NEO013": {"type": "NUMBER", "index": 377, "name": "DXCCSR_NEO013", "comment": null}, "DXCCSR_NEO014": {"type": "NUMBER", "index": 378, "name": "DXCCSR_NEO014", "comment": null}, "DXCCSR_NEO015": {"type": "NUMBER", "index": 379, "name": "DXCCSR_NEO015", "comment": null}, "DXCCSR_NEO016": {"type": "NUMBER", "index": 380, "name": "DXCCSR_NEO016", "comment": null}, "DXCCSR_NEO017": {"type": "NUMBER", "index": 381, "name": "DXCCSR_NEO017", "comment": null}, "DXCCSR_NEO018": {"type": "NUMBER", "index": 382, "name": "DXCCSR_NEO018", "comment": null}, "DXCCSR_NEO019": {"type": "NUMBER", "index": 383, "name": "DXCCSR_NEO019", "comment": null}, "DXCCSR_NEO020": {"type": "NUMBER", "index": 384, "name": "DXCCSR_NEO020", "comment": null}, "DXCCSR_NEO021": {"type": "NUMBER", "index": 385, "name": "DXCCSR_NEO021", "comment": null}, "DXCCSR_NEO022": {"type": "NUMBER", "index": 386, "name": "DXCCSR_NEO022", "comment": null}, "DXCCSR_NEO023": {"type": "NUMBER", "index": 387, "name": "DXCCSR_NEO023", "comment": null}, "DXCCSR_NEO024": {"type": "NUMBER", "index": 388, "name": "DXCCSR_NEO024", "comment": null}, "DXCCSR_NEO025": {"type": "NUMBER", "index": 389, "name": "DXCCSR_NEO025", "comment": null}, "DXCCSR_NEO026": {"type": "NUMBER", "index": 390, "name": "DXCCSR_NEO026", "comment": null}, "DXCCSR_NEO027": {"type": "NUMBER", "index": 391, "name": "DXCCSR_NEO027", "comment": null}, "DXCCSR_NEO028": {"type": "NUMBER", "index": 392, "name": "DXCCSR_NEO028", "comment": null}, "DXCCSR_NEO029": {"type": "NUMBER", "index": 393, "name": "DXCCSR_NEO029", "comment": null}, "DXCCSR_NEO030": {"type": "NUMBER", "index": 394, "name": "DXCCSR_NEO030", "comment": null}, "DXCCSR_NEO031": {"type": "NUMBER", "index": 395, "name": "DXCCSR_NEO031", "comment": null}, "DXCCSR_NEO032": {"type": "NUMBER", "index": 396, "name": "DXCCSR_NEO032", "comment": null}, "DXCCSR_NEO033": {"type": "NUMBER", "index": 397, "name": "DXCCSR_NEO033", "comment": null}, "DXCCSR_NEO034": {"type": "NUMBER", "index": 398, "name": "DXCCSR_NEO034", "comment": null}, "DXCCSR_NEO035": {"type": "NUMBER", "index": 399, "name": "DXCCSR_NEO035", "comment": null}, "DXCCSR_NEO036": {"type": "NUMBER", "index": 400, "name": "DXCCSR_NEO036", "comment": null}, "DXCCSR_NEO037": {"type": "NUMBER", "index": 401, "name": "DXCCSR_NEO037", "comment": null}, "DXCCSR_NEO038": {"type": "NUMBER", "index": 402, "name": "DXCCSR_NEO038", "comment": null}, "DXCCSR_NEO039": {"type": "NUMBER", "index": 403, "name": "DXCCSR_NEO039", "comment": null}, "DXCCSR_NEO040": {"type": "NUMBER", "index": 404, "name": "DXCCSR_NEO040", "comment": null}, "DXCCSR_NEO041": {"type": "NUMBER", "index": 405, "name": "DXCCSR_NEO041", "comment": null}, "DXCCSR_NEO042": {"type": "NUMBER", "index": 406, "name": "DXCCSR_NEO042", "comment": null}, "DXCCSR_NEO043": {"type": "NUMBER", "index": 407, "name": "DXCCSR_NEO043", "comment": null}, "DXCCSR_NEO044": {"type": "NUMBER", "index": 408, "name": "DXCCSR_NEO044", "comment": null}, "DXCCSR_NEO045": {"type": "NUMBER", "index": 409, "name": "DXCCSR_NEO045", "comment": null}, "DXCCSR_NEO046": {"type": "NUMBER", "index": 410, "name": "DXCCSR_NEO046", "comment": null}, "DXCCSR_NEO047": {"type": "NUMBER", "index": 411, "name": "DXCCSR_NEO047", "comment": null}, "DXCCSR_NEO048": {"type": "NUMBER", "index": 412, "name": "DXCCSR_NEO048", "comment": null}, "DXCCSR_NEO049": {"type": "NUMBER", "index": 413, "name": "DXCCSR_NEO049", "comment": null}, "DXCCSR_NEO050": {"type": "NUMBER", "index": 414, "name": "DXCCSR_NEO050", "comment": null}, "DXCCSR_NEO051": {"type": "NUMBER", "index": 415, "name": "DXCCSR_NEO051", "comment": null}, "DXCCSR_NEO052": {"type": "NUMBER", "index": 416, "name": "DXCCSR_NEO052", "comment": null}, "DXCCSR_NEO053": {"type": "NUMBER", "index": 417, "name": "DXCCSR_NEO053", "comment": null}, "DXCCSR_NEO054": {"type": "NUMBER", "index": 418, "name": "DXCCSR_NEO054", "comment": null}, "DXCCSR_NEO055": {"type": "NUMBER", "index": 419, "name": "DXCCSR_NEO055", "comment": null}, "DXCCSR_NEO056": {"type": "NUMBER", "index": 420, "name": "DXCCSR_NEO056", "comment": null}, "DXCCSR_NEO057": {"type": "NUMBER", "index": 421, "name": "DXCCSR_NEO057", "comment": null}, "DXCCSR_NEO058": {"type": "NUMBER", "index": 422, "name": "DXCCSR_NEO058", "comment": null}, "DXCCSR_NEO059": {"type": "NUMBER", "index": 423, "name": "DXCCSR_NEO059", "comment": null}, "DXCCSR_NEO060": {"type": "NUMBER", "index": 424, "name": "DXCCSR_NEO060", "comment": null}, "DXCCSR_NEO061": {"type": "NUMBER", "index": 425, "name": "DXCCSR_NEO061", "comment": null}, "DXCCSR_NEO062": {"type": "NUMBER", "index": 426, "name": "DXCCSR_NEO062", "comment": null}, "DXCCSR_NEO063": {"type": "NUMBER", "index": 427, "name": "DXCCSR_NEO063", "comment": null}, "DXCCSR_NEO064": {"type": "NUMBER", "index": 428, "name": "DXCCSR_NEO064", "comment": null}, "DXCCSR_NEO065": {"type": "NUMBER", "index": 429, "name": "DXCCSR_NEO065", "comment": null}, "DXCCSR_NEO066": {"type": "NUMBER", "index": 430, "name": "DXCCSR_NEO066", "comment": null}, "DXCCSR_NEO067": {"type": "NUMBER", "index": 431, "name": "DXCCSR_NEO067", "comment": null}, "DXCCSR_NEO068": {"type": "NUMBER", "index": 432, "name": "DXCCSR_NEO068", "comment": null}, "DXCCSR_NEO069": {"type": "NUMBER", "index": 433, "name": "DXCCSR_NEO069", "comment": null}, "DXCCSR_NEO070": {"type": "NUMBER", "index": 434, "name": "DXCCSR_NEO070", "comment": null}, "DXCCSR_NEO071": {"type": "NUMBER", "index": 435, "name": "DXCCSR_NEO071", "comment": null}, "DXCCSR_NEO072": {"type": "NUMBER", "index": 436, "name": "DXCCSR_NEO072", "comment": null}, "DXCCSR_NEO073": {"type": "NUMBER", "index": 437, "name": "DXCCSR_NEO073", "comment": null}, "DXCCSR_NEO074": {"type": "NUMBER", "index": 438, "name": "DXCCSR_NEO074", "comment": null}, "DXCCSR_NVS001": {"type": "NUMBER", "index": 439, "name": "DXCCSR_NVS001", "comment": null}, "DXCCSR_NVS002": {"type": "NUMBER", "index": 440, "name": "DXCCSR_NVS002", "comment": null}, "DXCCSR_NVS003": {"type": "NUMBER", "index": 441, "name": "DXCCSR_NVS003", "comment": null}, "DXCCSR_NVS004": {"type": "NUMBER", "index": 442, "name": "DXCCSR_NVS004", "comment": null}, "DXCCSR_NVS005": {"type": "NUMBER", "index": 443, "name": "DXCCSR_NVS005", "comment": null}, "DXCCSR_NVS006": {"type": "NUMBER", "index": 444, "name": "DXCCSR_NVS006", "comment": null}, "DXCCSR_NVS007": {"type": "NUMBER", "index": 445, "name": "DXCCSR_NVS007", "comment": null}, "DXCCSR_NVS008": {"type": "NUMBER", "index": 446, "name": "DXCCSR_NVS008", "comment": null}, "DXCCSR_NVS009": {"type": "NUMBER", "index": 447, "name": "DXCCSR_NVS009", "comment": null}, "DXCCSR_NVS010": {"type": "NUMBER", "index": 448, "name": "DXCCSR_NVS010", "comment": null}, "DXCCSR_NVS011": {"type": "NUMBER", "index": 449, "name": "DXCCSR_NVS011", "comment": null}, "DXCCSR_NVS012": {"type": "NUMBER", "index": 450, "name": "DXCCSR_NVS012", "comment": null}, "DXCCSR_NVS013": {"type": "NUMBER", "index": 451, "name": "DXCCSR_NVS013", "comment": null}, "DXCCSR_NVS014": {"type": "NUMBER", "index": 452, "name": "DXCCSR_NVS014", "comment": null}, "DXCCSR_NVS015": {"type": "NUMBER", "index": 453, "name": "DXCCSR_NVS015", "comment": null}, "DXCCSR_NVS016": {"type": "NUMBER", "index": 454, "name": "DXCCSR_NVS016", "comment": null}, "DXCCSR_NVS017": {"type": "NUMBER", "index": 455, "name": "DXCCSR_NVS017", "comment": null}, "DXCCSR_NVS018": {"type": "NUMBER", "index": 456, "name": "DXCCSR_NVS018", "comment": null}, "DXCCSR_NVS019": {"type": "NUMBER", "index": 457, "name": "DXCCSR_NVS019", "comment": null}, "DXCCSR_NVS020": {"type": "NUMBER", "index": 458, "name": "DXCCSR_NVS020", "comment": null}, "DXCCSR_NVS021": {"type": "NUMBER", "index": 459, "name": "DXCCSR_NVS021", "comment": null}, "DXCCSR_NVS022": {"type": "NUMBER", "index": 460, "name": "DXCCSR_NVS022", "comment": null}, "DXCCSR_PNL001": {"type": "NUMBER", "index": 461, "name": "DXCCSR_PNL001", "comment": null}, "DXCCSR_PNL002": {"type": "NUMBER", "index": 462, "name": "DXCCSR_PNL002", "comment": null}, "DXCCSR_PNL003": {"type": "NUMBER", "index": 463, "name": "DXCCSR_PNL003", "comment": null}, "DXCCSR_PNL004": {"type": "NUMBER", "index": 464, "name": "DXCCSR_PNL004", "comment": null}, "DXCCSR_PNL005": {"type": "NUMBER", "index": 465, "name": "DXCCSR_PNL005", "comment": null}, "DXCCSR_PNL006": {"type": "NUMBER", "index": 466, "name": "DXCCSR_PNL006", "comment": null}, "DXCCSR_PNL007": {"type": "NUMBER", "index": 467, "name": "DXCCSR_PNL007", "comment": null}, "DXCCSR_PNL008": {"type": "NUMBER", "index": 468, "name": "DXCCSR_PNL008", "comment": null}, "DXCCSR_PNL009": {"type": "NUMBER", "index": 469, "name": "DXCCSR_PNL009", "comment": null}, "DXCCSR_PNL010": {"type": "NUMBER", "index": 470, "name": "DXCCSR_PNL010", "comment": null}, "DXCCSR_PNL011": {"type": "NUMBER", "index": 471, "name": "DXCCSR_PNL011", "comment": null}, "DXCCSR_PNL012": {"type": "NUMBER", "index": 472, "name": "DXCCSR_PNL012", "comment": null}, "DXCCSR_PNL013": {"type": "NUMBER", "index": 473, "name": "DXCCSR_PNL013", "comment": null}, "DXCCSR_PNL014": {"type": "NUMBER", "index": 474, "name": "DXCCSR_PNL014", "comment": null}, "DXCCSR_PNL015": {"type": "NUMBER", "index": 475, "name": "DXCCSR_PNL015", "comment": null}, "DXCCSR_PRG001": {"type": "NUMBER", "index": 476, "name": "DXCCSR_PRG001", "comment": null}, "DXCCSR_PRG002": {"type": "NUMBER", "index": 477, "name": "DXCCSR_PRG002", "comment": null}, "DXCCSR_PRG003": {"type": "NUMBER", "index": 478, "name": "DXCCSR_PRG003", "comment": null}, "DXCCSR_PRG004": {"type": "NUMBER", "index": 479, "name": "DXCCSR_PRG004", "comment": null}, "DXCCSR_PRG005": {"type": "NUMBER", "index": 480, "name": "DXCCSR_PRG005", "comment": null}, "DXCCSR_PRG006": {"type": "NUMBER", "index": 481, "name": "DXCCSR_PRG006", "comment": null}, "DXCCSR_PRG007": {"type": "NUMBER", "index": 482, "name": "DXCCSR_PRG007", "comment": null}, "DXCCSR_PRG008": {"type": "NUMBER", "index": 483, "name": "DXCCSR_PRG008", "comment": null}, "DXCCSR_PRG009": {"type": "NUMBER", "index": 484, "name": "DXCCSR_PRG009", "comment": null}, "DXCCSR_PRG010": {"type": "NUMBER", "index": 485, "name": "DXCCSR_PRG010", "comment": null}, "DXCCSR_PRG011": {"type": "NUMBER", "index": 486, "name": "DXCCSR_PRG011", "comment": null}, "DXCCSR_PRG012": {"type": "NUMBER", "index": 487, "name": "DXCCSR_PRG012", "comment": null}, "DXCCSR_PRG013": {"type": "NUMBER", "index": 488, "name": "DXCCSR_PRG013", "comment": null}, "DXCCSR_PRG014": {"type": "NUMBER", "index": 489, "name": "DXCCSR_PRG014", "comment": null}, "DXCCSR_PRG015": {"type": "NUMBER", "index": 490, "name": "DXCCSR_PRG015", "comment": null}, "DXCCSR_PRG016": {"type": "NUMBER", "index": 491, "name": "DXCCSR_PRG016", "comment": null}, "DXCCSR_PRG017": {"type": "NUMBER", "index": 492, "name": "DXCCSR_PRG017", "comment": null}, "DXCCSR_PRG018": {"type": "NUMBER", "index": 493, "name": "DXCCSR_PRG018", "comment": null}, "DXCCSR_PRG019": {"type": "NUMBER", "index": 494, "name": "DXCCSR_PRG019", "comment": null}, "DXCCSR_PRG020": {"type": "NUMBER", "index": 495, "name": "DXCCSR_PRG020", "comment": null}, "DXCCSR_PRG021": {"type": "NUMBER", "index": 496, "name": "DXCCSR_PRG021", "comment": null}, "DXCCSR_PRG022": {"type": "NUMBER", "index": 497, "name": "DXCCSR_PRG022", "comment": null}, "DXCCSR_PRG023": {"type": "NUMBER", "index": 498, "name": "DXCCSR_PRG023", "comment": null}, "DXCCSR_PRG024": {"type": "NUMBER", "index": 499, "name": "DXCCSR_PRG024", "comment": null}, "DXCCSR_PRG025": {"type": "NUMBER", "index": 500, "name": "DXCCSR_PRG025", "comment": null}, "DXCCSR_PRG026": {"type": "NUMBER", "index": 501, "name": "DXCCSR_PRG026", "comment": null}, "DXCCSR_PRG027": {"type": "NUMBER", "index": 502, "name": "DXCCSR_PRG027", "comment": null}, "DXCCSR_PRG028": {"type": "NUMBER", "index": 503, "name": "DXCCSR_PRG028", "comment": null}, "DXCCSR_PRG029": {"type": "NUMBER", "index": 504, "name": "DXCCSR_PRG029", "comment": null}, "DXCCSR_PRG030": {"type": "NUMBER", "index": 505, "name": "DXCCSR_PRG030", "comment": null}, "DXCCSR_RSP001": {"type": "NUMBER", "index": 506, "name": "DXCCSR_RSP001", "comment": null}, "DXCCSR_RSP002": {"type": "NUMBER", "index": 507, "name": "DXCCSR_RSP002", "comment": null}, "DXCCSR_RSP003": {"type": "NUMBER", "index": 508, "name": "DXCCSR_RSP003", "comment": null}, "DXCCSR_RSP004": {"type": "NUMBER", "index": 509, "name": "DXCCSR_RSP004", "comment": null}, "DXCCSR_RSP005": {"type": "NUMBER", "index": 510, "name": "DXCCSR_RSP005", "comment": null}, "DXCCSR_RSP006": {"type": "NUMBER", "index": 511, "name": "DXCCSR_RSP006", "comment": null}, "DXCCSR_RSP007": {"type": "NUMBER", "index": 512, "name": "DXCCSR_RSP007", "comment": null}, "DXCCSR_RSP008": {"type": "NUMBER", "index": 513, "name": "DXCCSR_RSP008", "comment": null}, "DXCCSR_RSP009": {"type": "NUMBER", "index": 514, "name": "DXCCSR_RSP009", "comment": null}, "DXCCSR_RSP010": {"type": "NUMBER", "index": 515, "name": "DXCCSR_RSP010", "comment": null}, "DXCCSR_RSP011": {"type": "NUMBER", "index": 516, "name": "DXCCSR_RSP011", "comment": null}, "DXCCSR_RSP012": {"type": "NUMBER", "index": 517, "name": "DXCCSR_RSP012", "comment": null}, "DXCCSR_RSP013": {"type": "NUMBER", "index": 518, "name": "DXCCSR_RSP013", "comment": null}, "DXCCSR_RSP014": {"type": "NUMBER", "index": 519, "name": "DXCCSR_RSP014", "comment": null}, "DXCCSR_RSP015": {"type": "NUMBER", "index": 520, "name": "DXCCSR_RSP015", "comment": null}, "DXCCSR_RSP016": {"type": "NUMBER", "index": 521, "name": "DXCCSR_RSP016", "comment": null}, "DXCCSR_RSP017": {"type": "NUMBER", "index": 522, "name": "DXCCSR_RSP017", "comment": null}, "DXCCSR_SKN001": {"type": "NUMBER", "index": 523, "name": "DXCCSR_SKN001", "comment": null}, "DXCCSR_SKN002": {"type": "NUMBER", "index": 524, "name": "DXCCSR_SKN002", "comment": null}, "DXCCSR_SKN003": {"type": "NUMBER", "index": 525, "name": "DXCCSR_SKN003", "comment": null}, "DXCCSR_SKN004": {"type": "NUMBER", "index": 526, "name": "DXCCSR_SKN004", "comment": null}, "DXCCSR_SKN005": {"type": "NUMBER", "index": 527, "name": "DXCCSR_SKN005", "comment": null}, "DXCCSR_SKN006": {"type": "NUMBER", "index": 528, "name": "DXCCSR_SKN006", "comment": null}, "DXCCSR_SKN007": {"type": "NUMBER", "index": 529, "name": "DXCCSR_SKN007", "comment": null}, "DXCCSR_SYM001": {"type": "NUMBER", "index": 530, "name": "DXCCSR_SYM001", "comment": null}, "DXCCSR_SYM002": {"type": "NUMBER", "index": 531, "name": "DXCCSR_SYM002", "comment": null}, "DXCCSR_SYM003": {"type": "NUMBER", "index": 532, "name": "DXCCSR_SYM003", "comment": null}, "DXCCSR_SYM004": {"type": "NUMBER", "index": 533, "name": "DXCCSR_SYM004", "comment": null}, "DXCCSR_SYM005": {"type": "NUMBER", "index": 534, "name": "DXCCSR_SYM005", "comment": null}, "DXCCSR_SYM006": {"type": "NUMBER", "index": 535, "name": "DXCCSR_SYM006", "comment": null}, "DXCCSR_SYM007": {"type": "NUMBER", "index": 536, "name": "DXCCSR_SYM007", "comment": null}, "DXCCSR_SYM008": {"type": "NUMBER", "index": 537, "name": "DXCCSR_SYM008", "comment": null}, "DXCCSR_SYM009": {"type": "NUMBER", "index": 538, "name": "DXCCSR_SYM009", "comment": null}, "DXCCSR_SYM010": {"type": "NUMBER", "index": 539, "name": "DXCCSR_SYM010", "comment": null}, "DXCCSR_SYM011": {"type": "NUMBER", "index": 540, "name": "DXCCSR_SYM011", "comment": null}, "DXCCSR_SYM012": {"type": "NUMBER", "index": 541, "name": "DXCCSR_SYM012", "comment": null}, "DXCCSR_SYM013": {"type": "NUMBER", "index": 542, "name": "DXCCSR_SYM013", "comment": null}, "DXCCSR_SYM014": {"type": "NUMBER", "index": 543, "name": "DXCCSR_SYM014", "comment": null}, "DXCCSR_SYM015": {"type": "NUMBER", "index": 544, "name": "DXCCSR_SYM015", "comment": null}, "DXCCSR_SYM016": {"type": "NUMBER", "index": 545, "name": "DXCCSR_SYM016", "comment": null}, "DXCCSR_SYM017": {"type": "NUMBER", "index": 546, "name": "DXCCSR_SYM017", "comment": null}, "DXCCSR_VERSION": {"type": "TEXT", "index": 547, "name": "DXCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 548, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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__wide_condition_category"}, "model.the_tuva_project.core__stg_claims_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 23, "name": "CHARGE_AMOUNT", "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": {"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_claims_encounter"}, "model.the_tuva_project.core__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 11, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 12, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 13, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 14, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 17, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 18, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 19, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 20, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 21, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 22, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 23, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 24, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 30, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 31, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 32, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 33, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 34, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 35, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 36, "name": "CHARGE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 37, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 38, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 39, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__inpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_REHAB_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "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": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "NUMBER", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 147456.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.readmissions__readmission_crude": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_READMISSION_CRUDE", "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}, "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.readmissions__encounter_specialty_cohort": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_SPECIALTY_COHORT", "database": "TUVA", "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"}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_CPT_HCPCS", "database": "TUVA", "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": 32741.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 89600.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.claims_data_model.observation": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "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": "TEXT", "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.claims_data_model.observation"}, "model.the_tuva_project.readmissions__encounter_overlap": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_OVERLAP", "database": "TUVA", "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.service_category__outpatient_hospital_or_clinic_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "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": "TUVA", "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": 36.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "model.the_tuva_project.readmissions__encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_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}, "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}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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.readmissions__encounter"}, "model.the_tuva_project.readmissions__encounter_data_quality": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_DATA_QUALITY", "database": "TUVA", "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}, "MULTIPLE_PRIMARY_DIAGNOSES_FLAG": {"type": "NUMBER", "index": 10, "name": "MULTIPLE_PRIMARY_DIAGNOSES_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 11, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 12, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 13, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 14, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 15, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "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.quality_measures__summary_counts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_COUNTS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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__urgent_care_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_detail_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_MEDICAL_CLAIM", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_detail_stage_medical_claim"}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_DUAL_ELIGIBILITY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_CCS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.cms_hcc__int_members": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_MEMBERS", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 12, "name": "MODEL_VERSION", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ADJUSTMENT_RATES", "database": "TUVA", "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": "FLOAT", "index": 3, "name": "NORMALIZATION_FACTOR", "comment": null}, "MA_CODING_PATTERN_ADJUSTMENT": {"type": "FLOAT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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__procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.terminology__ssa_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SSA_FIPS_STATE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.core__stg_clinical_medication": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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.service_category__dq_multiple_service_categories_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 23, "name": "CHARGE_AMOUNT", "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": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__stg_clinical_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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.chronic_conditions__cms_chronic_conditions_all": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_ALL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__lab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__patient_risk_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS", "database": "TUVA", "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}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 6, "name": "COEFFICIENT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__test_detail_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_ELIGIBILITY", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_detail_stage_eligibility"}, "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": "TUVA", "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": 2.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.service_category__dme_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DME_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_date_profiling__date_issues": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "DATE_ISSUES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DESCRIPTION": {"type": "TEXT", "index": 1, "name": "TEST_DESCRIPTION", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "CLAIM_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": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.claims_date_profiling__date_issues"}, "model.claims_data_model.eligibility": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "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.claims_data_model.eligibility"}, "model.the_tuva_project.core__stg_claims_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 14, "name": "LATITUDE", "comment": null}, "LOGITUDE": {"type": "FLOAT", "index": 15, "name": "LOGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 17, "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_claims_patient"}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_TESTS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.chronic_conditions__cms_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_LONG", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_data_model.encounter": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "TEXT", "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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "TEXT", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "TEXT", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "TEXT", "index": 23, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 24, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 25, "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.claims_data_model.encounter"}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_DISCHARGE_REQUIREMENT", "database": "TUVA", "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.service_category__ambulance_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULANCE_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__pharmacy_claim_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__pharmacy_claim_missing_values"}, "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_LONG_SNAPSHOT", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 6, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 7, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 8, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 10, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 11, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 12, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}, "DBT_SCD_ID": {"type": "TEXT", "index": 14, "name": "DBT_SCD_ID", "comment": null}, "DBT_UPDATED_AT": {"type": "TEXT", "index": 15, "name": "DBT_UPDATED_AT", "comment": null}, "DBT_VALID_FROM": {"type": "TEXT", "index": 16, "name": "DBT_VALID_FROM", "comment": null}, "DBT_VALID_TO": {"type": "TEXT", "index": 17, "name": "DBT_VALID_TO", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.the_tuva_project.quality_measures__summary_long_snapshot"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_institutional"}, "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": "TUVA", "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}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 55368.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 300032.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 34304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.financial_pmpm__member_months": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "MEMBER_MONTHS", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__service_category_grouper": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SERVICE_CATEGORY_GROUPER", "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}, "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__skilled_nursing_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__eligibility_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_INVALID_VALUES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 6, "name": "PATIENT_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 7, "name": "GENDER", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 8, "name": "FILLED_ROW_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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__eligibility_invalid_values"}, "model.claims_data_model.medication": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "TEXT", "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": "TEXT", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "TEXT", "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": "TEXT", "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.claims_data_model.medication"}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_PSYCHIATRIC_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_EXCLUSION_CCS_DIAGNOSIS_CATEGORY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.core__stg_clinical_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 19, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 21, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 22, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 23, "name": "CHARGE_AMOUNT", "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": {"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.terminology__icd_9_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_CM", "database": "TUVA", "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": 14568.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 393728.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.readmissions__icd_10_pcs_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_PCS_TO_CCS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1416192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.cms_hcc__enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ENROLLMENT_INTERACTION_FACTORS", "database": "TUVA", "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}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "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": 7.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.core__observation": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_date_profiling__pharmacy_claim_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_DATES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 2, "name": "DISPENSING_DATE", "comment": null}, "PAID_DATE": {"type": "NUMBER", "index": 3, "name": "PAID_DATE", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates"}, "model.claims_data_model.patient": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "TEXT", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "TEXT", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "TEXT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "TEXT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "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.claims_data_model.patient"}, "seed.the_tuva_project.terminology__place_of_service": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PLACE_OF_SERVICE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.core__stg_clinical_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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.core__stg_claims_medical_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 11, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 12, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 13, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 14, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 17, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 18, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 19, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 20, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 21, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 22, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 23, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 24, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 30, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 31, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 32, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 33, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 34, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 35, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 36, "name": "CHARGE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 37, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 38, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 39, "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_claims_medical_claim"}, "model.the_tuva_project.service_category__emergency_department_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 14, "name": "ALLOWED_AMOUNT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1539584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.financial_pmpm__patient_spend_with_service_categories": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_PATIENT_SPEND_WITH_SERVICE_CATEGORIES", "database": "TUVA", "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}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 4, "name": "SERVICE_CATEGORY_2", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 6, "name": "TOTAL_ALLOWED", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.quality_measures__int_nqf2372_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUSIONS", "database": "TUVA", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 9, "name": "EXCLUSION_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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__test_catalog": {"metadata": {"type": "BASE TABLE", "schema": "DATA_PROFILING", "name": "_VALUE_SET_TEST_CATALOG", "database": "TUVA", "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}, "MEDICAL_CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "MEDICAL_CLAIM_TYPE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 242.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4608.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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_profiling__test_catalog"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.claims_data_model.condition": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "TEXT", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "TEXT", "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": "TEXT", "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": "TEXT", "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.claims_data_model.condition"}, "model.the_tuva_project.claims_date_profiling__duplicate_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DUPLICATE_DATES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_START_DATE": {"type": "NUMBER", "index": 1, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 2, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 3, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "MED_PAID_DATE": {"type": "NUMBER", "index": 5, "name": "MED_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 6, "name": "DISPENSING_DATE", "comment": null}, "RX_PAID_DATE": {"type": "NUMBER", "index": 7, "name": "RX_PAID_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": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.claims_date_profiling__duplicate_dates"}, "seed.the_tuva_project.terminology__gender": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "GENDER", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.ccsr__singular_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "SINGULAR_CONDITION_CATEGORY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.core__stg_clinical_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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"}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DEMOGRAPHIC_FACTORS", "database": "TUVA", "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": 424.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "seed.the_tuva_project.terminology__ethnicity": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ETHNICITY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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__specialty_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SPECIALTY_COHORT", "database": "TUVA", "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": 276.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "TUVA", "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__data_quality_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_DATA_QUALITY_SUMMARY", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__int_enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ENROLLMENT_INTERACTION_FACTORS", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.readmissions__diagnosis_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_DIAGNOSIS_CCS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CODE": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CODE", "comment": null}, "DIAGNOSIS_RANK": {"type": "NUMBER", "index": 3, "name": "DIAGNOSIS_RANK", "comment": null}, "VALID_ICD_10_CM_FLAG": {"type": "NUMBER", "index": 4, "name": "VALID_ICD_10_CM_FLAG", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 5, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "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__diagnosis_ccs"}, "seed.the_tuva_project.terminology__mdc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MDC", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.data_profiling__professional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAIL_DETAILS", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__professional_header_fail_details"}, "model.the_tuva_project.core__medication": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__test_detail": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_DETAIL", "database": "TUVA", "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}, "FOREIGN_KEY": {"type": "TEXT", "index": 6, "name": "FOREIGN_KEY", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_detail"}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_UNMAPPED", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__claim_type_unmapped"}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "HCPCS_LEVEL_2", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 368640.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.data_profiling__medical_claim_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INVALID_VALUES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 6, "name": "CLAIM_ID", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "FILLED_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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__medical_claim_invalid_values"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_HOSPICE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_hospice"}, "model.the_tuva_project.data_profiling__test_result_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_ELIGIBILITY", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_result_stage_eligibility"}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__dq_input_layer_results": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_RESULTS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.financial_pmpm__service_category_1_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_ALLOWED_PIVOT", "database": "TUVA", "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}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 3, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 4, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 5, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 6, "name": "ANCILLARY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 7, "name": "OTHER_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 8, "name": "PHARMACY_ALLOWED", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISABLED_INTERACTION_FACTORS", "database": "TUVA", "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": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "seed.the_tuva_project.terminology__revenue_center": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "REVENUE_CENTER", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.claims_data_model.lab_result": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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": "TEXT", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "TEXT", "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": "TEXT", "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.claims_data_model.lab_result"}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_COUNT_FACTORS", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__home_health_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__eligibility_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_PLAUSIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 6, "name": "PATIENT_ID", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__eligibility_plausibility"}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "DX_VERTICAL_PIVOT", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2385408.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__office_visit_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OFFICE_VISIT_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.cms_hcc__int_eligible_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ELIGIBLE_CONDITIONS", "database": "TUVA", "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}, "MODEL_VERSION": {"type": "TEXT", "index": 3, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 4, "name": "PAYMENT_YEAR", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.service_category__service_categories": {"metadata": {"type": "BASE TABLE", "schema": "SERVICE_CATEGORY", "name": "_VALUE_SET_SERVICE_CATEGORIES", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.ccsr__long_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_PROCEDURE_CATEGORY", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__emergency_department_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_HIERARCHY", "database": "TUVA", "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": {"row_count": {"id": "row_count", "label": "Row Count", "value": 72.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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_profiling__test_detail_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_PHARMACY_CLAIM", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_detail_stage_pharmacy_claim"}, "model.the_tuva_project.service_category__combined_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.core__lab_result": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__claim_type_mapping_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_MAPPING_FAILURES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__claim_type_mapping_failures"}, "model.the_tuva_project.readmissions__planned_encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PLANNED_ENCOUNTER", "database": "TUVA", "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.core__patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 14, "name": "LATITUDE", "comment": null}, "LOGITUDE": {"type": "FLOAT", "index": 15, "name": "LOGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.acute_inpatient__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "ACUTE_INPATIENT_SUMMARY", "database": "TUVA", "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}, "FACILITY_NPI": {"type": "TEXT", "index": 8, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 9, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 10, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 11, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 13, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 14, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 16, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 20, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 22, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 23, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 24, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 25, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 26, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL_ENCOUNTER_ID", "database": "TUVA", "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}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 6, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 7, "name": "ENCOUNTER_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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.terminology__provider": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PROVIDER", "database": "TUVA", "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": 7944248.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 244484608.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.financial_pmpm__service_category_1_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_PAID_PIVOT", "database": "TUVA", "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}, "INPATIENT_PAID": {"type": "NUMBER", "index": 3, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 4, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 5, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 6, "name": "ANCILLARY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 7, "name": "OTHER_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 8, "name": "PHARMACY_PAID", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__outpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__stg_claims_pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 5, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 6, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 8, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 9, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 10, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 11, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 12, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 14, "name": "ALLOWED_AMOUNT", "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": {"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_claims_pharmacy_claim"}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_INTERACTION_FACTORS", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.terminology__icd_9_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_PCS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 105984.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.quality_measures__summary_wide": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_WIDE", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__outpatient_hospital_or_clinic_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_INSTITUTIONAL", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.terminology__apr_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "APR_DRG", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"APR_DRG_CODE": {"type": "TEXT", "index": 1, "name": "APR_DRG_CODE", "comment": null}, "SEVERITY": {"type": "TEXT", "index": 2, "name": "SEVERITY", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "APR_DRG_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1272.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 12288.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.terminology__race": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RACE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.readmissions__always_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "TUVA", "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": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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_profiling__professional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAILURES", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 138, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__professional_header_failures"}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISABLED_INTERACTION_FACTORS", "database": "TUVA", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__stg_clinical_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "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_claims_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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": {"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_claims_practitioner"}, "model.the_tuva_project.service_category__dialysis_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.ccsr__procedure_category_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "PROCEDURE_CATEGORY_MAP", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1553408.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.quality_measures__int_nqf2372_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_DENOMINATOR", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__stg_clinical_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_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}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 17, "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"}, "seed.claims_data_model.medical_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "TUVA_SYNTHETIC", "name": "MEDICAL_CLAIM_SEED", "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}, "CLAIM_START_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 7, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 10, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 11, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 12, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 13, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 14, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 15, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 16, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 17, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 18, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 19, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 20, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 21, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 22, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 23, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 27, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 28, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 29, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 30, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 31, "name": "PAID_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 32, "name": "TOTAL_COST_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 33, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 34, "name": "CHARGE_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 35, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 36, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 37, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 38, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 39, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 86, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 87, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 88, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 89, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 90, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 112, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 113, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 114, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 115, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 116, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 137, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.claims_data_model.medical_claim_seed"}, "model.the_tuva_project.service_category__home_health_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.readmissions__procedure_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PROCEDURE_CCS", "database": "TUVA", "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.acute_inpatient__institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_CLAIMS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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__medicare_status": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_STATUS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.claims_data_model.eligibility_seed": {"metadata": {"type": "BASE TABLE", "schema": "TUVA_SYNTHETIC", "name": "ELIGIBILITY_SEED", "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}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 5, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 6, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 7, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 8, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 10, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 11, "name": "PAYER_TYPE", "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}, "FIRST_NAME": {"type": "TEXT", "index": 14, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 15, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 16, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 17, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 18, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 19, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 20, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.claims_data_model.eligibility_seed"}, "seed.the_tuva_project.terminology__discharge_disposition": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "DISCHARGE_DISPOSITION", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "seed.the_tuva_project.terminology__admit_source": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_SOURCE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.data_profiling__medical_claim_prof_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PROF_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__medical_claim_prof_missing_values"}, "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": "TUVA", "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}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 3, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 4, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 5, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 6, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 7, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 8, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 9, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 10, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 11, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 12, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 13, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 14, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 15, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 16, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 17, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 18, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 19, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.service_category__urgent_care_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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"}, "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_COUNTS_SNAPSHOT", "database": "TUVA", "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}, "DBT_SCD_ID": {"type": "TEXT", "index": 11, "name": "DBT_SCD_ID", "comment": null}, "DBT_UPDATED_AT": {"type": "TEXT", "index": 12, "name": "DBT_UPDATED_AT", "comment": null}, "DBT_VALID_FROM": {"type": "TEXT", "index": 13, "name": "DBT_VALID_FROM", "comment": null}, "DBT_VALID_TO": {"type": "TEXT", "index": 14, "name": "DBT_VALID_TO", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot"}, "model.the_tuva_project.readmissions__diagnosis": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_STG_DIAGNOSIS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CODE": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CODE", "comment": null}, "DIAGNOSIS_RANK": {"type": "NUMBER", "index": 3, "name": "DIAGNOSIS_RANK", "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__diagnosis"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_ADVANCED_ILLNESS", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_advanced_illness"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_PALLIATIVE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_palliative"}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULATORY_SURGERY_PROFESSIONAL", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.readmissions__primary_diagnosis_count": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PRIMARY_DIAGNOSIS_COUNT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PRIMARY_DX_COUNT": {"type": "NUMBER", "index": 2, "name": "PRIMARY_DX_COUNT", "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__primary_diagnosis_count"}, "model.the_tuva_project.readmissions__exclusion": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_EXCLUSION", "database": "TUVA", "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.data_profiling__medical_claim_inst_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INST_MISSING_VALUES", "database": "TUVA", "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}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 6, "name": "TEST_NAME", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__medical_claim_inst_missing_values"}, "seed.the_tuva_project.quality_measures__measures": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_MEASURES", "database": "TUVA", "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": "NUMBER", "index": 4, "name": "VERSION", "comment": null}, "STEWARD": {"type": "TEXT", "index": 5, "name": "STEWARD", "comment": null}, "COMPATIBLE_MEASURE": {"type": "TEXT", "index": 6, "name": "COMPATIBLE_MEASURE", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.ccsr__wide_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "WIDE_PROCEDURE_CATEGORY", "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}, "PRCCSR_ADM001": {"type": "NUMBER", "index": 3, "name": "PRCCSR_ADM001", "comment": null}, "PRCCSR_ADM002": {"type": "NUMBER", "index": 4, "name": "PRCCSR_ADM002", "comment": null}, "PRCCSR_ADM003": {"type": "NUMBER", "index": 5, "name": "PRCCSR_ADM003", "comment": null}, "PRCCSR_ADM004": {"type": "NUMBER", "index": 6, "name": "PRCCSR_ADM004", "comment": null}, "PRCCSR_ADM005": {"type": "NUMBER", "index": 7, "name": "PRCCSR_ADM005", "comment": null}, "PRCCSR_ADM006": {"type": "NUMBER", "index": 8, "name": "PRCCSR_ADM006", "comment": null}, "PRCCSR_ADM007": {"type": "NUMBER", "index": 9, "name": "PRCCSR_ADM007", "comment": null}, "PRCCSR_ADM008": {"type": "NUMBER", "index": 10, "name": "PRCCSR_ADM008", "comment": null}, "PRCCSR_ADM009": {"type": "NUMBER", "index": 11, "name": "PRCCSR_ADM009", "comment": null}, "PRCCSR_ADM010": {"type": "NUMBER", "index": 12, "name": "PRCCSR_ADM010", "comment": null}, "PRCCSR_ADM011": {"type": "NUMBER", "index": 13, "name": "PRCCSR_ADM011", "comment": null}, "PRCCSR_ADM012": {"type": "NUMBER", "index": 14, "name": "PRCCSR_ADM012", "comment": null}, "PRCCSR_ADM013": {"type": "NUMBER", "index": 15, "name": "PRCCSR_ADM013", "comment": null}, "PRCCSR_ADM014": {"type": "NUMBER", "index": 16, "name": "PRCCSR_ADM014", "comment": null}, "PRCCSR_ADM015": {"type": "NUMBER", "index": 17, "name": "PRCCSR_ADM015", "comment": null}, "PRCCSR_ADM016": {"type": "NUMBER", "index": 18, "name": "PRCCSR_ADM016", "comment": null}, "PRCCSR_ADM017": {"type": "NUMBER", "index": 19, "name": "PRCCSR_ADM017", "comment": null}, "PRCCSR_ADM018": {"type": "NUMBER", "index": 20, "name": "PRCCSR_ADM018", "comment": null}, "PRCCSR_ADM019": {"type": "NUMBER", "index": 21, "name": "PRCCSR_ADM019", "comment": null}, "PRCCSR_ADM020": {"type": "NUMBER", "index": 22, "name": "PRCCSR_ADM020", "comment": null}, "PRCCSR_ADM021": {"type": "NUMBER", "index": 23, "name": "PRCCSR_ADM021", "comment": null}, "PRCCSR_ADM022": {"type": "NUMBER", "index": 24, "name": "PRCCSR_ADM022", "comment": null}, "PRCCSR_CAR001": {"type": "NUMBER", "index": 25, "name": "PRCCSR_CAR001", "comment": null}, "PRCCSR_CAR002": {"type": "NUMBER", "index": 26, "name": "PRCCSR_CAR002", "comment": null}, "PRCCSR_CAR003": {"type": "NUMBER", "index": 27, "name": "PRCCSR_CAR003", "comment": null}, "PRCCSR_CAR004": {"type": "NUMBER", "index": 28, "name": "PRCCSR_CAR004", "comment": null}, "PRCCSR_CAR005": {"type": "NUMBER", "index": 29, "name": "PRCCSR_CAR005", "comment": null}, "PRCCSR_CAR006": {"type": "NUMBER", "index": 30, "name": "PRCCSR_CAR006", "comment": null}, "PRCCSR_CAR007": {"type": "NUMBER", "index": 31, "name": "PRCCSR_CAR007", "comment": null}, "PRCCSR_CAR008": {"type": "NUMBER", "index": 32, "name": "PRCCSR_CAR008", "comment": null}, "PRCCSR_CAR009": {"type": "NUMBER", "index": 33, "name": "PRCCSR_CAR009", "comment": null}, "PRCCSR_CAR010": {"type": "NUMBER", "index": 34, "name": "PRCCSR_CAR010", "comment": null}, "PRCCSR_CAR011": {"type": "NUMBER", "index": 35, "name": "PRCCSR_CAR011", "comment": null}, "PRCCSR_CAR012": {"type": "NUMBER", "index": 36, "name": "PRCCSR_CAR012", "comment": null}, "PRCCSR_CAR013": {"type": "NUMBER", "index": 37, "name": "PRCCSR_CAR013", "comment": null}, "PRCCSR_CAR014": {"type": "NUMBER", "index": 38, "name": "PRCCSR_CAR014", "comment": null}, "PRCCSR_CAR015": {"type": "NUMBER", "index": 39, "name": "PRCCSR_CAR015", "comment": null}, "PRCCSR_CAR016": {"type": "NUMBER", "index": 40, "name": "PRCCSR_CAR016", "comment": null}, "PRCCSR_CAR017": {"type": "NUMBER", "index": 41, "name": "PRCCSR_CAR017", "comment": null}, "PRCCSR_CAR018": {"type": "NUMBER", "index": 42, "name": "PRCCSR_CAR018", "comment": null}, "PRCCSR_CAR019": {"type": "NUMBER", "index": 43, "name": "PRCCSR_CAR019", "comment": null}, "PRCCSR_CAR020": {"type": "NUMBER", "index": 44, "name": "PRCCSR_CAR020", "comment": null}, "PRCCSR_CAR021": {"type": "NUMBER", "index": 45, "name": "PRCCSR_CAR021", "comment": null}, "PRCCSR_CAR022": {"type": "NUMBER", "index": 46, "name": "PRCCSR_CAR022", "comment": null}, "PRCCSR_CAR023": {"type": "NUMBER", "index": 47, "name": "PRCCSR_CAR023", "comment": null}, "PRCCSR_CAR024": {"type": "NUMBER", "index": 48, "name": "PRCCSR_CAR024", "comment": null}, "PRCCSR_CAR025": {"type": "NUMBER", "index": 49, "name": "PRCCSR_CAR025", "comment": null}, "PRCCSR_CAR026": {"type": "NUMBER", "index": 50, "name": "PRCCSR_CAR026", "comment": null}, "PRCCSR_CAR027": {"type": "NUMBER", "index": 51, "name": "PRCCSR_CAR027", "comment": null}, "PRCCSR_CAR028": {"type": "NUMBER", "index": 52, "name": "PRCCSR_CAR028", "comment": null}, "PRCCSR_CAR029": {"type": "NUMBER", "index": 53, "name": "PRCCSR_CAR029", "comment": null}, "PRCCSR_CHP001": {"type": "NUMBER", "index": 54, "name": "PRCCSR_CHP001", "comment": null}, "PRCCSR_CNS001": {"type": "NUMBER", "index": 55, "name": "PRCCSR_CNS001", "comment": null}, "PRCCSR_CNS002": {"type": "NUMBER", "index": 56, "name": "PRCCSR_CNS002", "comment": null}, "PRCCSR_CNS003": {"type": "NUMBER", "index": 57, "name": "PRCCSR_CNS003", "comment": null}, "PRCCSR_CNS004": {"type": "NUMBER", "index": 58, "name": "PRCCSR_CNS004", "comment": null}, "PRCCSR_CNS005": {"type": "NUMBER", "index": 59, "name": "PRCCSR_CNS005", "comment": null}, "PRCCSR_CNS006": {"type": "NUMBER", "index": 60, "name": "PRCCSR_CNS006", "comment": null}, "PRCCSR_CNS007": {"type": "NUMBER", "index": 61, "name": "PRCCSR_CNS007", "comment": null}, "PRCCSR_CNS008": {"type": "NUMBER", "index": 62, "name": "PRCCSR_CNS008", "comment": null}, "PRCCSR_CNS009": {"type": "NUMBER", "index": 63, "name": "PRCCSR_CNS009", "comment": null}, "PRCCSR_CNS010": {"type": "NUMBER", "index": 64, "name": "PRCCSR_CNS010", "comment": null}, "PRCCSR_CNS011": {"type": "NUMBER", "index": 65, "name": "PRCCSR_CNS011", "comment": null}, "PRCCSR_CNS012": {"type": "NUMBER", "index": 66, "name": "PRCCSR_CNS012", "comment": null}, "PRCCSR_CNS013": {"type": "NUMBER", "index": 67, "name": "PRCCSR_CNS013", "comment": null}, "PRCCSR_CNS014": {"type": "NUMBER", "index": 68, "name": "PRCCSR_CNS014", "comment": null}, "PRCCSR_ENP001": {"type": "NUMBER", "index": 69, "name": "PRCCSR_ENP001", "comment": null}, "PRCCSR_ENP002": {"type": "NUMBER", "index": 70, "name": "PRCCSR_ENP002", "comment": null}, "PRCCSR_ENP003": {"type": "NUMBER", "index": 71, "name": "PRCCSR_ENP003", "comment": null}, "PRCCSR_ENP004": {"type": "NUMBER", "index": 72, "name": "PRCCSR_ENP004", "comment": null}, "PRCCSR_ENP005": {"type": "NUMBER", "index": 73, "name": "PRCCSR_ENP005", "comment": null}, "PRCCSR_ENP006": {"type": "NUMBER", "index": 74, "name": "PRCCSR_ENP006", "comment": null}, "PRCCSR_ENT001": {"type": "NUMBER", "index": 75, "name": "PRCCSR_ENT001", "comment": null}, "PRCCSR_ENT002": {"type": "NUMBER", "index": 76, "name": "PRCCSR_ENT002", "comment": null}, "PRCCSR_ENT003": {"type": "NUMBER", "index": 77, "name": "PRCCSR_ENT003", "comment": null}, "PRCCSR_ENT004": {"type": "NUMBER", "index": 78, "name": "PRCCSR_ENT004", "comment": null}, "PRCCSR_ENT005": {"type": "NUMBER", "index": 79, "name": "PRCCSR_ENT005", "comment": null}, "PRCCSR_ENT006": {"type": "NUMBER", "index": 80, "name": "PRCCSR_ENT006", "comment": null}, "PRCCSR_ENT007": {"type": "NUMBER", "index": 81, "name": "PRCCSR_ENT007", "comment": null}, "PRCCSR_ENT008": {"type": "NUMBER", "index": 82, "name": "PRCCSR_ENT008", "comment": null}, "PRCCSR_ENT009": {"type": "NUMBER", "index": 83, "name": "PRCCSR_ENT009", "comment": null}, "PRCCSR_ENT010": {"type": "NUMBER", "index": 84, "name": "PRCCSR_ENT010", "comment": null}, "PRCCSR_ENT011": {"type": "NUMBER", "index": 85, "name": "PRCCSR_ENT011", "comment": null}, "PRCCSR_ENT012": {"type": "NUMBER", "index": 86, "name": "PRCCSR_ENT012", "comment": null}, "PRCCSR_ENT013": {"type": "NUMBER", "index": 87, "name": "PRCCSR_ENT013", "comment": null}, "PRCCSR_ENT014": {"type": "NUMBER", "index": 88, "name": "PRCCSR_ENT014", "comment": null}, "PRCCSR_ENT015": {"type": "NUMBER", "index": 89, "name": "PRCCSR_ENT015", "comment": null}, "PRCCSR_ENT016": {"type": "NUMBER", "index": 90, "name": "PRCCSR_ENT016", "comment": null}, "PRCCSR_ENT017": {"type": "NUMBER", "index": 91, "name": "PRCCSR_ENT017", "comment": null}, "PRCCSR_ESA001": {"type": "NUMBER", "index": 92, "name": "PRCCSR_ESA001", "comment": null}, "PRCCSR_ESA002": {"type": "NUMBER", "index": 93, "name": "PRCCSR_ESA002", "comment": null}, "PRCCSR_ESA003": {"type": "NUMBER", "index": 94, "name": "PRCCSR_ESA003", "comment": null}, "PRCCSR_ESA004": {"type": "NUMBER", "index": 95, "name": "PRCCSR_ESA004", "comment": null}, "PRCCSR_ESA005": {"type": "NUMBER", "index": 96, "name": "PRCCSR_ESA005", "comment": null}, "PRCCSR_ESA006": {"type": "NUMBER", "index": 97, "name": "PRCCSR_ESA006", "comment": null}, "PRCCSR_ESA007": {"type": "NUMBER", "index": 98, "name": "PRCCSR_ESA007", "comment": null}, "PRCCSR_ESA008": {"type": "NUMBER", "index": 99, "name": "PRCCSR_ESA008", "comment": null}, "PRCCSR_ESA009": {"type": "NUMBER", "index": 100, "name": "PRCCSR_ESA009", "comment": null}, "PRCCSR_ESA010": {"type": "NUMBER", "index": 101, "name": "PRCCSR_ESA010", "comment": null}, "PRCCSR_ESA011": {"type": "NUMBER", "index": 102, "name": "PRCCSR_ESA011", "comment": null}, "PRCCSR_EST001": {"type": "NUMBER", "index": 103, "name": "PRCCSR_EST001", "comment": null}, "PRCCSR_EST002": {"type": "NUMBER", "index": 104, "name": "PRCCSR_EST002", "comment": null}, "PRCCSR_EST003": {"type": "NUMBER", "index": 105, "name": "PRCCSR_EST003", "comment": null}, "PRCCSR_EST004": {"type": "NUMBER", "index": 106, "name": "PRCCSR_EST004", "comment": null}, "PRCCSR_EST005": {"type": "NUMBER", "index": 107, "name": "PRCCSR_EST005", "comment": null}, "PRCCSR_EYP001": {"type": "NUMBER", "index": 108, "name": "PRCCSR_EYP001", "comment": null}, "PRCCSR_EYP002": {"type": "NUMBER", "index": 109, "name": "PRCCSR_EYP002", "comment": null}, "PRCCSR_FRS001": {"type": "NUMBER", "index": 110, "name": "PRCCSR_FRS001", "comment": null}, "PRCCSR_FRS002": {"type": "NUMBER", "index": 111, "name": "PRCCSR_FRS002", "comment": null}, "PRCCSR_FRS003": {"type": "NUMBER", "index": 112, "name": "PRCCSR_FRS003", "comment": null}, "PRCCSR_FRS004": {"type": "NUMBER", "index": 113, "name": "PRCCSR_FRS004", "comment": null}, "PRCCSR_FRS005": {"type": "NUMBER", "index": 114, "name": "PRCCSR_FRS005", "comment": null}, "PRCCSR_FRS006": {"type": "NUMBER", "index": 115, "name": "PRCCSR_FRS006", "comment": null}, "PRCCSR_FRS007": {"type": "NUMBER", "index": 116, "name": "PRCCSR_FRS007", "comment": null}, "PRCCSR_FRS008": {"type": "NUMBER", "index": 117, "name": "PRCCSR_FRS008", "comment": null}, "PRCCSR_FRS009": {"type": "NUMBER", "index": 118, "name": "PRCCSR_FRS009", "comment": null}, "PRCCSR_FRS010": {"type": "NUMBER", "index": 119, "name": "PRCCSR_FRS010", "comment": null}, "PRCCSR_FRS011": {"type": "NUMBER", "index": 120, "name": "PRCCSR_FRS011", "comment": null}, "PRCCSR_FRS012": {"type": "NUMBER", "index": 121, "name": "PRCCSR_FRS012", "comment": null}, "PRCCSR_FRS013": {"type": "NUMBER", "index": 122, "name": "PRCCSR_FRS013", "comment": null}, "PRCCSR_FRS014": {"type": "NUMBER", "index": 123, "name": "PRCCSR_FRS014", "comment": null}, "PRCCSR_FRS015": {"type": "NUMBER", "index": 124, "name": "PRCCSR_FRS015", "comment": null}, "PRCCSR_GIS001": {"type": "NUMBER", "index": 125, "name": "PRCCSR_GIS001", "comment": null}, "PRCCSR_GIS002": {"type": "NUMBER", "index": 126, "name": "PRCCSR_GIS002", "comment": null}, "PRCCSR_GIS003": {"type": "NUMBER", "index": 127, "name": "PRCCSR_GIS003", "comment": null}, "PRCCSR_GIS004": {"type": "NUMBER", "index": 128, "name": "PRCCSR_GIS004", "comment": null}, "PRCCSR_GIS005": {"type": "NUMBER", "index": 129, "name": "PRCCSR_GIS005", "comment": null}, "PRCCSR_GIS006": {"type": "NUMBER", "index": 130, "name": "PRCCSR_GIS006", "comment": null}, "PRCCSR_GIS007": {"type": "NUMBER", "index": 131, "name": "PRCCSR_GIS007", "comment": null}, "PRCCSR_GIS008": {"type": "NUMBER", "index": 132, "name": "PRCCSR_GIS008", "comment": null}, "PRCCSR_GIS009": {"type": "NUMBER", "index": 133, "name": "PRCCSR_GIS009", "comment": null}, "PRCCSR_GIS010": {"type": "NUMBER", "index": 134, "name": "PRCCSR_GIS010", "comment": null}, "PRCCSR_GIS011": {"type": "NUMBER", "index": 135, "name": "PRCCSR_GIS011", "comment": null}, "PRCCSR_GIS012": {"type": "NUMBER", "index": 136, "name": "PRCCSR_GIS012", "comment": null}, "PRCCSR_GIS013": {"type": "NUMBER", "index": 137, "name": "PRCCSR_GIS013", "comment": null}, "PRCCSR_GIS014": {"type": "NUMBER", "index": 138, "name": "PRCCSR_GIS014", "comment": null}, "PRCCSR_GIS015": {"type": "NUMBER", "index": 139, "name": "PRCCSR_GIS015", "comment": null}, "PRCCSR_GIS016": {"type": "NUMBER", "index": 140, "name": "PRCCSR_GIS016", "comment": null}, "PRCCSR_GIS017": {"type": "NUMBER", "index": 141, "name": "PRCCSR_GIS017", "comment": null}, "PRCCSR_GIS018": {"type": "NUMBER", "index": 142, "name": "PRCCSR_GIS018", "comment": null}, "PRCCSR_GIS019": {"type": "NUMBER", "index": 143, "name": "PRCCSR_GIS019", "comment": null}, "PRCCSR_GIS020": {"type": "NUMBER", "index": 144, "name": "PRCCSR_GIS020", "comment": null}, "PRCCSR_GIS021": {"type": "NUMBER", "index": 145, "name": "PRCCSR_GIS021", "comment": null}, "PRCCSR_GIS022": {"type": "NUMBER", "index": 146, "name": "PRCCSR_GIS022", "comment": null}, "PRCCSR_GIS023": {"type": "NUMBER", "index": 147, "name": "PRCCSR_GIS023", "comment": null}, "PRCCSR_GIS024": {"type": "NUMBER", "index": 148, "name": "PRCCSR_GIS024", "comment": null}, "PRCCSR_GIS025": {"type": "NUMBER", "index": 149, "name": "PRCCSR_GIS025", "comment": null}, "PRCCSR_GIS026": {"type": "NUMBER", "index": 150, "name": "PRCCSR_GIS026", "comment": null}, "PRCCSR_GIS027": {"type": "NUMBER", "index": 151, "name": "PRCCSR_GIS027", "comment": null}, "PRCCSR_GIS028": {"type": "NUMBER", "index": 152, "name": "PRCCSR_GIS028", "comment": null}, "PRCCSR_GIS029": {"type": "NUMBER", "index": 153, "name": "PRCCSR_GIS029", "comment": null}, "PRCCSR_GNR001": {"type": "NUMBER", "index": 154, "name": "PRCCSR_GNR001", "comment": null}, "PRCCSR_GNR002": {"type": "NUMBER", "index": 155, "name": "PRCCSR_GNR002", "comment": null}, "PRCCSR_GNR003": {"type": "NUMBER", "index": 156, "name": "PRCCSR_GNR003", "comment": null}, "PRCCSR_GNR004": {"type": "NUMBER", "index": 157, "name": "PRCCSR_GNR004", "comment": null}, "PRCCSR_GNR005": {"type": "NUMBER", "index": 158, "name": "PRCCSR_GNR005", "comment": null}, "PRCCSR_GNR006": {"type": "NUMBER", "index": 159, "name": "PRCCSR_GNR006", "comment": null}, "PRCCSR_GNR007": {"type": "NUMBER", "index": 160, "name": "PRCCSR_GNR007", "comment": null}, "PRCCSR_GNR008": {"type": "NUMBER", "index": 161, "name": "PRCCSR_GNR008", "comment": null}, "PRCCSR_GNR009": {"type": "NUMBER", "index": 162, "name": "PRCCSR_GNR009", "comment": null}, "PRCCSR_GNR010": {"type": "NUMBER", "index": 163, "name": "PRCCSR_GNR010", "comment": null}, "PRCCSR_HEP001": {"type": "NUMBER", "index": 164, "name": "PRCCSR_HEP001", "comment": null}, "PRCCSR_HEP002": {"type": "NUMBER", "index": 165, "name": "PRCCSR_HEP002", "comment": null}, "PRCCSR_HEP003": {"type": "NUMBER", "index": 166, "name": "PRCCSR_HEP003", "comment": null}, "PRCCSR_HEP004": {"type": "NUMBER", "index": 167, "name": "PRCCSR_HEP004", "comment": null}, "PRCCSR_HEP005": {"type": "NUMBER", "index": 168, "name": "PRCCSR_HEP005", "comment": null}, "PRCCSR_HEP006": {"type": "NUMBER", "index": 169, "name": "PRCCSR_HEP006", "comment": null}, "PRCCSR_HEP007": {"type": "NUMBER", "index": 170, "name": "PRCCSR_HEP007", "comment": null}, "PRCCSR_HEP008": {"type": "NUMBER", "index": 171, "name": "PRCCSR_HEP008", "comment": null}, "PRCCSR_HEP009": {"type": "NUMBER", "index": 172, "name": "PRCCSR_HEP009", "comment": null}, "PRCCSR_HEP010": {"type": "NUMBER", "index": 173, "name": "PRCCSR_HEP010", "comment": null}, "PRCCSR_HEP011": {"type": "NUMBER", "index": 174, "name": "PRCCSR_HEP011", "comment": null}, "PRCCSR_HEP012": {"type": "NUMBER", "index": 175, "name": "PRCCSR_HEP012", "comment": null}, "PRCCSR_HEP013": {"type": "NUMBER", "index": 176, "name": "PRCCSR_HEP013", "comment": null}, "PRCCSR_IMG001": {"type": "NUMBER", "index": 177, "name": "PRCCSR_IMG001", "comment": null}, "PRCCSR_IMG002": {"type": "NUMBER", "index": 178, "name": "PRCCSR_IMG002", "comment": null}, "PRCCSR_IMG003": {"type": "NUMBER", "index": 179, "name": "PRCCSR_IMG003", "comment": null}, "PRCCSR_IMG004": {"type": "NUMBER", "index": 180, "name": "PRCCSR_IMG004", "comment": null}, "PRCCSR_IMG005": {"type": "NUMBER", "index": 181, "name": "PRCCSR_IMG005", "comment": null}, "PRCCSR_IMG006": {"type": "NUMBER", "index": 182, "name": "PRCCSR_IMG006", "comment": null}, "PRCCSR_IMG007": {"type": "NUMBER", "index": 183, "name": "PRCCSR_IMG007", "comment": null}, "PRCCSR_IMG008": {"type": "NUMBER", "index": 184, "name": "PRCCSR_IMG008", "comment": null}, "PRCCSR_IMG009": {"type": "NUMBER", "index": 185, "name": "PRCCSR_IMG009", "comment": null}, "PRCCSR_IMG010": {"type": "NUMBER", "index": 186, "name": "PRCCSR_IMG010", "comment": null}, "PRCCSR_LYM001": {"type": "NUMBER", "index": 187, "name": "PRCCSR_LYM001", "comment": null}, "PRCCSR_LYM002": {"type": "NUMBER", "index": 188, "name": "PRCCSR_LYM002", "comment": null}, "PRCCSR_LYM003": {"type": "NUMBER", "index": 189, "name": "PRCCSR_LYM003", "comment": null}, "PRCCSR_LYM004": {"type": "NUMBER", "index": 190, "name": "PRCCSR_LYM004", "comment": null}, "PRCCSR_LYM005": {"type": "NUMBER", "index": 191, "name": "PRCCSR_LYM005", "comment": null}, "PRCCSR_LYM006": {"type": "NUMBER", "index": 192, "name": "PRCCSR_LYM006", "comment": null}, "PRCCSR_LYM007": {"type": "NUMBER", "index": 193, "name": "PRCCSR_LYM007", "comment": null}, "PRCCSR_LYM008": {"type": "NUMBER", "index": 194, "name": "PRCCSR_LYM008", "comment": null}, "PRCCSR_LYM009": {"type": "NUMBER", "index": 195, "name": "PRCCSR_LYM009", "comment": null}, "PRCCSR_LYM010": {"type": "NUMBER", "index": 196, "name": "PRCCSR_LYM010", "comment": null}, "PRCCSR_LYM011": {"type": "NUMBER", "index": 197, "name": "PRCCSR_LYM011", "comment": null}, "PRCCSR_MAM001": {"type": "NUMBER", "index": 198, "name": "PRCCSR_MAM001", "comment": null}, "PRCCSR_MAM002": {"type": "NUMBER", "index": 199, "name": "PRCCSR_MAM002", "comment": null}, "PRCCSR_MAM003": {"type": "NUMBER", "index": 200, "name": "PRCCSR_MAM003", "comment": null}, "PRCCSR_MAM004": {"type": "NUMBER", "index": 201, "name": "PRCCSR_MAM004", "comment": null}, "PRCCSR_MAM005": {"type": "NUMBER", "index": 202, "name": "PRCCSR_MAM005", "comment": null}, "PRCCSR_MAM006": {"type": "NUMBER", "index": 203, "name": "PRCCSR_MAM006", "comment": null}, "PRCCSR_MAM007": {"type": "NUMBER", "index": 204, "name": "PRCCSR_MAM007", "comment": null}, "PRCCSR_MAM008": {"type": "NUMBER", "index": 205, "name": "PRCCSR_MAM008", "comment": null}, "PRCCSR_MAM009": {"type": "NUMBER", "index": 206, "name": "PRCCSR_MAM009", "comment": null}, "PRCCSR_MAM010": {"type": "NUMBER", "index": 207, "name": "PRCCSR_MAM010", "comment": null}, "PRCCSR_MAM011": {"type": "NUMBER", "index": 208, "name": "PRCCSR_MAM011", "comment": null}, "PRCCSR_MAM012": {"type": "NUMBER", "index": 209, "name": "PRCCSR_MAM012", "comment": null}, "PRCCSR_MAM013": {"type": "NUMBER", "index": 210, "name": "PRCCSR_MAM013", "comment": null}, "PRCCSR_MAM014": {"type": "NUMBER", "index": 211, "name": "PRCCSR_MAM014", "comment": null}, "PRCCSR_MAM015": {"type": "NUMBER", "index": 212, "name": "PRCCSR_MAM015", "comment": null}, "PRCCSR_MHT001": {"type": "NUMBER", "index": 213, "name": "PRCCSR_MHT001", "comment": null}, "PRCCSR_MHT002": {"type": "NUMBER", "index": 214, "name": "PRCCSR_MHT002", "comment": null}, "PRCCSR_MHT003": {"type": "NUMBER", "index": 215, "name": "PRCCSR_MHT003", "comment": null}, "PRCCSR_MHT004": {"type": "NUMBER", "index": 216, "name": "PRCCSR_MHT004", "comment": null}, "PRCCSR_MHT005": {"type": "NUMBER", "index": 217, "name": "PRCCSR_MHT005", "comment": null}, "PRCCSR_MRS001": {"type": "NUMBER", "index": 218, "name": "PRCCSR_MRS001", "comment": null}, "PRCCSR_MRS002": {"type": "NUMBER", "index": 219, "name": "PRCCSR_MRS002", "comment": null}, "PRCCSR_MRS003": {"type": "NUMBER", "index": 220, "name": "PRCCSR_MRS003", "comment": null}, "PRCCSR_MRS004": {"type": "NUMBER", "index": 221, "name": "PRCCSR_MRS004", "comment": null}, "PRCCSR_MRS005": {"type": "NUMBER", "index": 222, "name": "PRCCSR_MRS005", "comment": null}, "PRCCSR_MRS006": {"type": "NUMBER", "index": 223, "name": "PRCCSR_MRS006", "comment": null}, "PRCCSR_MRS007": {"type": "NUMBER", "index": 224, "name": "PRCCSR_MRS007", "comment": null}, "PRCCSR_MST001": {"type": "NUMBER", "index": 225, "name": "PRCCSR_MST001", "comment": null}, "PRCCSR_MST002": {"type": "NUMBER", "index": 226, "name": "PRCCSR_MST002", "comment": null}, "PRCCSR_MST003": {"type": "NUMBER", "index": 227, "name": "PRCCSR_MST003", "comment": null}, "PRCCSR_MST004": {"type": "NUMBER", "index": 228, "name": "PRCCSR_MST004", "comment": null}, "PRCCSR_MST005": {"type": "NUMBER", "index": 229, "name": "PRCCSR_MST005", "comment": null}, "PRCCSR_MST006": {"type": "NUMBER", "index": 230, "name": "PRCCSR_MST006", "comment": null}, "PRCCSR_MST007": {"type": "NUMBER", "index": 231, "name": "PRCCSR_MST007", "comment": null}, "PRCCSR_MST008": {"type": "NUMBER", "index": 232, "name": "PRCCSR_MST008", "comment": null}, "PRCCSR_MST009": {"type": "NUMBER", "index": 233, "name": "PRCCSR_MST009", "comment": null}, "PRCCSR_MST010": {"type": "NUMBER", "index": 234, "name": "PRCCSR_MST010", "comment": null}, "PRCCSR_MST011": {"type": "NUMBER", "index": 235, "name": "PRCCSR_MST011", "comment": null}, "PRCCSR_MST012": {"type": "NUMBER", "index": 236, "name": "PRCCSR_MST012", "comment": null}, "PRCCSR_MST013": {"type": "NUMBER", "index": 237, "name": "PRCCSR_MST013", "comment": null}, "PRCCSR_MST014": {"type": "NUMBER", "index": 238, "name": "PRCCSR_MST014", "comment": null}, "PRCCSR_MST015": {"type": "NUMBER", "index": 239, "name": "PRCCSR_MST015", "comment": null}, "PRCCSR_MST016": {"type": "NUMBER", "index": 240, "name": "PRCCSR_MST016", "comment": null}, "PRCCSR_MST017": {"type": "NUMBER", "index": 241, "name": "PRCCSR_MST017", "comment": null}, "PRCCSR_MST018": {"type": "NUMBER", "index": 242, "name": "PRCCSR_MST018", "comment": null}, "PRCCSR_MST019": {"type": "NUMBER", "index": 243, "name": "PRCCSR_MST019", "comment": null}, "PRCCSR_MST020": {"type": "NUMBER", "index": 244, "name": "PRCCSR_MST020", "comment": null}, "PRCCSR_MST021": {"type": "NUMBER", "index": 245, "name": "PRCCSR_MST021", "comment": null}, "PRCCSR_MST022": {"type": "NUMBER", "index": 246, "name": "PRCCSR_MST022", "comment": null}, "PRCCSR_MST023": {"type": "NUMBER", "index": 247, "name": "PRCCSR_MST023", "comment": null}, "PRCCSR_MST024": {"type": "NUMBER", "index": 248, "name": "PRCCSR_MST024", "comment": null}, "PRCCSR_MST025": {"type": "NUMBER", "index": 249, "name": "PRCCSR_MST025", "comment": null}, "PRCCSR_MST026": {"type": "NUMBER", "index": 250, "name": "PRCCSR_MST026", "comment": null}, "PRCCSR_MST027": {"type": "NUMBER", "index": 251, "name": "PRCCSR_MST027", "comment": null}, "PRCCSR_MST028": {"type": "NUMBER", "index": 252, "name": "PRCCSR_MST028", "comment": null}, "PRCCSR_MST029": {"type": "NUMBER", "index": 253, "name": "PRCCSR_MST029", "comment": null}, "PRCCSR_MST030": {"type": "NUMBER", "index": 254, "name": "PRCCSR_MST030", "comment": null}, "PRCCSR_NCM001": {"type": "NUMBER", "index": 255, "name": "PRCCSR_NCM001", "comment": null}, "PRCCSR_NCM002": {"type": "NUMBER", "index": 256, "name": "PRCCSR_NCM002", "comment": null}, "PRCCSR_NCM003": {"type": "NUMBER", "index": 257, "name": "PRCCSR_NCM003", "comment": null}, "PRCCSR_NCM004": {"type": "NUMBER", "index": 258, "name": "PRCCSR_NCM004", "comment": null}, "PRCCSR_OST001": {"type": "NUMBER", "index": 259, "name": "PRCCSR_OST001", "comment": null}, "PRCCSR_OTR001": {"type": "NUMBER", "index": 260, "name": "PRCCSR_OTR001", "comment": null}, "PRCCSR_OTR002": {"type": "NUMBER", "index": 261, "name": "PRCCSR_OTR002", "comment": null}, "PRCCSR_OTR003": {"type": "NUMBER", "index": 262, "name": "PRCCSR_OTR003", "comment": null}, "PRCCSR_OTR004": {"type": "NUMBER", "index": 263, "name": "PRCCSR_OTR004", "comment": null}, "PRCCSR_OTR005": {"type": "NUMBER", "index": 264, "name": "PRCCSR_OTR005", "comment": null}, "PRCCSR_PGN001": {"type": "NUMBER", "index": 265, "name": "PRCCSR_PGN001", "comment": null}, "PRCCSR_PGN002": {"type": "NUMBER", "index": 266, "name": "PRCCSR_PGN002", "comment": null}, "PRCCSR_PGN003": {"type": "NUMBER", "index": 267, "name": "PRCCSR_PGN003", "comment": null}, "PRCCSR_PGN004": {"type": "NUMBER", "index": 268, "name": "PRCCSR_PGN004", "comment": null}, "PRCCSR_PGN005": {"type": "NUMBER", "index": 269, "name": "PRCCSR_PGN005", "comment": null}, "PRCCSR_PGN006": {"type": "NUMBER", "index": 270, "name": "PRCCSR_PGN006", "comment": null}, "PRCCSR_PGN007": {"type": "NUMBER", "index": 271, "name": "PRCCSR_PGN007", "comment": null}, "PRCCSR_PGN008": {"type": "NUMBER", "index": 272, "name": "PRCCSR_PGN008", "comment": null}, "PRCCSR_PGN009": {"type": "NUMBER", "index": 273, "name": "PRCCSR_PGN009", "comment": null}, "PRCCSR_PLC001": {"type": "NUMBER", "index": 274, "name": "PRCCSR_PLC001", "comment": null}, "PRCCSR_PLC002": {"type": "NUMBER", "index": 275, "name": "PRCCSR_PLC002", "comment": null}, "PRCCSR_PNS001": {"type": "NUMBER", "index": 276, "name": "PRCCSR_PNS001", "comment": null}, "PRCCSR_PNS002": {"type": "NUMBER", "index": 277, "name": "PRCCSR_PNS002", "comment": null}, "PRCCSR_PNS003": {"type": "NUMBER", "index": 278, "name": "PRCCSR_PNS003", "comment": null}, "PRCCSR_PNS004": {"type": "NUMBER", "index": 279, "name": "PRCCSR_PNS004", "comment": null}, "PRCCSR_PNS005": {"type": "NUMBER", "index": 280, "name": "PRCCSR_PNS005", "comment": null}, "PRCCSR_PNS006": {"type": "NUMBER", "index": 281, "name": "PRCCSR_PNS006", "comment": null}, "PRCCSR_RAD001": {"type": "NUMBER", "index": 282, "name": "PRCCSR_RAD001", "comment": null}, "PRCCSR_RAD002": {"type": "NUMBER", "index": 283, "name": "PRCCSR_RAD002", "comment": null}, "PRCCSR_RAD003": {"type": "NUMBER", "index": 284, "name": "PRCCSR_RAD003", "comment": null}, "PRCCSR_RAD004": {"type": "NUMBER", "index": 285, "name": "PRCCSR_RAD004", "comment": null}, "PRCCSR_RES001": {"type": "NUMBER", "index": 286, "name": "PRCCSR_RES001", "comment": null}, "PRCCSR_RES002": {"type": "NUMBER", "index": 287, "name": "PRCCSR_RES002", "comment": null}, "PRCCSR_RES003": {"type": "NUMBER", "index": 288, "name": "PRCCSR_RES003", "comment": null}, "PRCCSR_RES004": {"type": "NUMBER", "index": 289, "name": "PRCCSR_RES004", "comment": null}, "PRCCSR_RES005": {"type": "NUMBER", "index": 290, "name": "PRCCSR_RES005", "comment": null}, "PRCCSR_RES006": {"type": "NUMBER", "index": 291, "name": "PRCCSR_RES006", "comment": null}, "PRCCSR_RES007": {"type": "NUMBER", "index": 292, "name": "PRCCSR_RES007", "comment": null}, "PRCCSR_RES008": {"type": "NUMBER", "index": 293, "name": "PRCCSR_RES008", "comment": null}, "PRCCSR_RES009": {"type": "NUMBER", "index": 294, "name": "PRCCSR_RES009", "comment": null}, "PRCCSR_RES010": {"type": "NUMBER", "index": 295, "name": "PRCCSR_RES010", "comment": null}, "PRCCSR_RES011": {"type": "NUMBER", "index": 296, "name": "PRCCSR_RES011", "comment": null}, "PRCCSR_RES012": {"type": "NUMBER", "index": 297, "name": "PRCCSR_RES012", "comment": null}, "PRCCSR_RES013": {"type": "NUMBER", "index": 298, "name": "PRCCSR_RES013", "comment": null}, "PRCCSR_RES014": {"type": "NUMBER", "index": 299, "name": "PRCCSR_RES014", "comment": null}, "PRCCSR_RHB001": {"type": "NUMBER", "index": 300, "name": "PRCCSR_RHB001", "comment": null}, "PRCCSR_RHB002": {"type": "NUMBER", "index": 301, "name": "PRCCSR_RHB002", "comment": null}, "PRCCSR_RHB003": {"type": "NUMBER", "index": 302, "name": "PRCCSR_RHB003", "comment": null}, "PRCCSR_RHB004": {"type": "NUMBER", "index": 303, "name": "PRCCSR_RHB004", "comment": null}, "PRCCSR_SKB001": {"type": "NUMBER", "index": 304, "name": "PRCCSR_SKB001", "comment": null}, "PRCCSR_SKB002": {"type": "NUMBER", "index": 305, "name": "PRCCSR_SKB002", "comment": null}, "PRCCSR_SKB003": {"type": "NUMBER", "index": 306, "name": "PRCCSR_SKB003", "comment": null}, "PRCCSR_SKB004": {"type": "NUMBER", "index": 307, "name": "PRCCSR_SKB004", "comment": null}, "PRCCSR_SKB005": {"type": "NUMBER", "index": 308, "name": "PRCCSR_SKB005", "comment": null}, "PRCCSR_SKB006": {"type": "NUMBER", "index": 309, "name": "PRCCSR_SKB006", "comment": null}, "PRCCSR_SKB007": {"type": "NUMBER", "index": 310, "name": "PRCCSR_SKB007", "comment": null}, "PRCCSR_SKB008": {"type": "NUMBER", "index": 311, "name": "PRCCSR_SKB008", "comment": null}, "PRCCSR_SKB009": {"type": "NUMBER", "index": 312, "name": "PRCCSR_SKB009", "comment": null}, "PRCCSR_SKB010": {"type": "NUMBER", "index": 313, "name": "PRCCSR_SKB010", "comment": null}, "PRCCSR_SUD001": {"type": "NUMBER", "index": 314, "name": "PRCCSR_SUD001", "comment": null}, "PRCCSR_SUD002": {"type": "NUMBER", "index": 315, "name": "PRCCSR_SUD002", "comment": null}, "PRCCSR_SUD003": {"type": "NUMBER", "index": 316, "name": "PRCCSR_SUD003", "comment": null}, "PRCCSR_SUD004": {"type": "NUMBER", "index": 317, "name": "PRCCSR_SUD004", "comment": null}, "PRCCSR_URN001": {"type": "NUMBER", "index": 318, "name": "PRCCSR_URN001", "comment": null}, "PRCCSR_URN002": {"type": "NUMBER", "index": 319, "name": "PRCCSR_URN002", "comment": null}, "PRCCSR_URN003": {"type": "NUMBER", "index": 320, "name": "PRCCSR_URN003", "comment": null}, "PRCCSR_URN004": {"type": "NUMBER", "index": 321, "name": "PRCCSR_URN004", "comment": null}, "PRCCSR_URN005": {"type": "NUMBER", "index": 322, "name": "PRCCSR_URN005", "comment": null}, "PRCCSR_URN006": {"type": "NUMBER", "index": 323, "name": "PRCCSR_URN006", "comment": null}, "PRCCSR_URN007": {"type": "NUMBER", "index": 324, "name": "PRCCSR_URN007", "comment": null}, "PRCCSR_URN008": {"type": "NUMBER", "index": 325, "name": "PRCCSR_URN008", "comment": null}, "PRCCSR_URN009": {"type": "NUMBER", "index": 326, "name": "PRCCSR_URN009", "comment": null}, "PRCCSR_URN010": {"type": "NUMBER", "index": 327, "name": "PRCCSR_URN010", "comment": null}, "PRCCSR_URN011": {"type": "NUMBER", "index": 328, "name": "PRCCSR_URN011", "comment": null}, "PRCCSR_URN012": {"type": "NUMBER", "index": 329, "name": "PRCCSR_URN012", "comment": null}, "PRCCSR_VERSION": {"type": "TEXT", "index": 330, "name": "PRCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 331, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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__wide_procedure_category"}, "seed.the_tuva_project.terminology__ms_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MS_DRG", "database": "TUVA", "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": 797.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 16384.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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"}, "model.the_tuva_project.claims_date_profiling__date_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "DATE_SUMMARY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 2, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 4, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 5, "name": "DISCHARGE_DATE", "comment": null}, "MEDICAL_PAID_DATE": {"type": "NUMBER", "index": 6, "name": "MEDICAL_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 7, "name": "DISPENSING_DATE", "comment": null}, "RX_PAID_DATE": {"type": "NUMBER", "index": 8, "name": "RX_PAID_DATE", "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": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.claims_date_profiling__date_summary"}, "seed.the_tuva_project.terminology__present_on_admission": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PRESENT_ON_ADMISSION", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.chronic_conditions__tuva_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_WIDE", "database": "TUVA", "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}, "ALCOHOL": {"type": "NUMBER", "index": 3, "name": "ALCOHOL", "comment": null}, "ALZHEIMERS_DISEASE": {"type": "NUMBER", "index": 4, "name": "ALZHEIMERS_DISEASE", "comment": null}, "AMYOTROPHIC_LATERAL_SCLEROSIS": {"type": "NUMBER", "index": 5, "name": "AMYOTROPHIC_LATERAL_SCLEROSIS", "comment": null}, "ANXIETY": {"type": "NUMBER", "index": 6, "name": "ANXIETY", "comment": null}, "ASTHMA": {"type": "NUMBER", "index": 7, "name": "ASTHMA", "comment": null}, "ATHEROSCLEROSIS": {"type": "NUMBER", "index": 8, "name": "ATHEROSCLEROSIS", "comment": null}, "ATRIAL_FIBRILLATION": {"type": "NUMBER", "index": 9, "name": "ATRIAL_FIBRILLATION", "comment": null}, "ATTENTION_DEFICIT_HYPERACTIVITY_DISORDER": {"type": "NUMBER", "index": 10, "name": "ATTENTION_DEFICIT_HYPERACTIVITY_DISORDER", "comment": null}, "BIPOLAR": {"type": "NUMBER", "index": 11, "name": "BIPOLAR", "comment": null}, "BREAST_CANCER": {"type": "NUMBER", "index": 12, "name": "BREAST_CANCER", "comment": null}, "CHRONIC_KIDNEY_DISEASE": {"type": "NUMBER", "index": 13, "name": "CHRONIC_KIDNEY_DISEASE", "comment": null}, "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE": {"type": "NUMBER", "index": 14, "name": "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE", "comment": null}, "COCAINE": {"type": "NUMBER", "index": 15, "name": "COCAINE", "comment": null}, "COLORECTAL_CANCER": {"type": "NUMBER", "index": 16, "name": "COLORECTAL_CANCER", "comment": null}, "CROHNS_DISEASE": {"type": "NUMBER", "index": 17, "name": "CROHNS_DISEASE", "comment": null}, "CYSTIC_FIBROSIS": {"type": "NUMBER", "index": 18, "name": "CYSTIC_FIBROSIS", "comment": null}, "DEMENTIA": {"type": "NUMBER", "index": 19, "name": "DEMENTIA", "comment": null}, "DEPRESSION": {"type": "NUMBER", "index": 20, "name": "DEPRESSION", "comment": null}, "HEART_FAILURE": {"type": "NUMBER", "index": 21, "name": "HEART_FAILURE", "comment": null}, "HYPERLIPIDEMIA": {"type": "NUMBER", "index": 22, "name": "HYPERLIPIDEMIA", "comment": null}, "HYPERTENSION": {"type": "NUMBER", "index": 23, "name": "HYPERTENSION", "comment": null}, "LUNG_CANCER": {"type": "NUMBER", "index": 24, "name": "LUNG_CANCER", "comment": null}, "LUPUS": {"type": "NUMBER", "index": 25, "name": "LUPUS", "comment": null}, "METABOLIC_SYNDROME": {"type": "NUMBER", "index": 26, "name": "METABOLIC_SYNDROME", "comment": null}, "MULTIPLE_SCLEROSIS": {"type": "NUMBER", "index": 27, "name": "MULTIPLE_SCLEROSIS", "comment": null}, "MUSCULAR_DYSTROPHY": {"type": "NUMBER", "index": 28, "name": "MUSCULAR_DYSTROPHY", "comment": null}, "OBESITY": {"type": "NUMBER", "index": 29, "name": "OBESITY", "comment": null}, "OBSESSIVE_COMPULSIVE_DISORDER": {"type": "NUMBER", "index": 30, "name": "OBSESSIVE_COMPULSIVE_DISORDER", "comment": null}, "OPIOID": {"type": "NUMBER", "index": 31, "name": "OPIOID", "comment": null}, "PARKINSONS_DISEASE": {"type": "NUMBER", "index": 32, "name": "PARKINSONS_DISEASE", "comment": null}, "PERSONALITY_DISORDER": {"type": "NUMBER", "index": 33, "name": "PERSONALITY_DISORDER", "comment": null}, "POST_TRAUMATIC_STRESS_DISORDER": {"type": "NUMBER", "index": 34, "name": "POST_TRAUMATIC_STRESS_DISORDER", "comment": null}, "RHEUMATOID_ARTHRITIS": {"type": "NUMBER", "index": 35, "name": "RHEUMATOID_ARTHRITIS", "comment": null}, "SCHIZOPHRENIA": {"type": "NUMBER", "index": 36, "name": "SCHIZOPHRENIA", "comment": null}, "STROKE": {"type": "NUMBER", "index": 37, "name": "STROKE", "comment": null}, "TOBACCO": {"type": "NUMBER", "index": 38, "name": "TOBACCO", "comment": null}, "TYPE_1_DIABETES": {"type": "NUMBER", "index": 39, "name": "TYPE_1_DIABETES", "comment": null}, "TYPE_2_DIABETES": {"type": "NUMBER", "index": 40, "name": "TYPE_2_DIABETES", "comment": null}, "ULCERATIVE_COLITIS": {"type": "NUMBER", "index": 41, "name": "ULCERATIVE_COLITIS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 42, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.core__condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "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}, "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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.data_profiling__test_result": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_RESULT", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_result"}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_MEDICAL_CLAIM", "database": "TUVA", "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}, "FAILURES": {"type": "NUMBER", "index": 6, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 7, "name": "DENOMINATOR", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__test_result_stage_medical_claim"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 35840.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.data_profiling__medical_claim_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PLAUSIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 4, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 5, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 6, "name": "CLAIM_ID", "comment": null}, "COUNTS": {"type": "NUMBER", "index": 7, "name": "COUNTS", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "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_profiling__medical_claim_plausibility"}, "seed.the_tuva_project.terminology__payer_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PAYER_TYPE", "database": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.claims_data_model.practitioner": {"metadata": {"type": "VIEW", "schema": "CLAIMS_DATA_MODEL", "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}, "TUVA_LAST_RUN": {"type": "TEXT", "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.claims_data_model.practitioner"}, "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES_SNAPSHOT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RAW_RISK_SCORE": {"type": "NUMBER", "index": 2, "name": "RAW_RISK_SCORE", "comment": null}, "NORMALIZED_RISK_SCORE": {"type": "NUMBER", "index": 3, "name": "NORMALIZED_RISK_SCORE", "comment": null}, "PAYMENT_RISK_SCORE": {"type": "NUMBER", "index": 4, "name": "PAYMENT_RISK_SCORE", "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}, "DBT_SCD_ID": {"type": "TEXT", "index": 8, "name": "DBT_SCD_ID", "comment": null}, "DBT_UPDATED_AT": {"type": "TEXT", "index": 9, "name": "DBT_UPDATED_AT", "comment": null}, "DBT_VALID_FROM": {"type": "TEXT", "index": 10, "name": "DBT_VALID_FROM", "comment": null}, "DBT_VALID_TO": {"type": "TEXT", "index": 11, "name": "DBT_VALID_TO", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 40960.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot"}, "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": "TUVA", "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"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:03UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "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.core__stg_claims_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_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}, "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_claims_location"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 46648895c..7ed6e5e32 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v8.json", "dbt_version": "1.4.5", "generated_at": "2023-09-05T20:45:29.461221Z", "invocation_id": "b330cbb2-d728-4604-a8cc-149d73befad1", "env": {}, "project_id": "228f02ae210381b07ccf62fcaa654d94", "user_id": "7acd446d-f397-41c9-9f69-07656e135a86", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.claims_data_model.condition": {"database": "tuva", "schema": "claims_data_model", "name": "condition", "resource_type": "model", "package_name": "claims_data_model", "path": "condition.sql", "original_file_path": "models\\condition.sql", "unique_id": "model.claims_data_model.condition", "fqn": ["claims_data_model", "condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "9cdc84897903c87ec4ad9aed73dfea03ac3bf67d5a9dc7e9a4367df79d6bc0a0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\condition.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2485573, "relation_name": "tuva.claims_data_model.condition", "raw_code": "select\r\n null as condition_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as recorded_date\r\n, null as onset_date\r\n, null as resolved_date\r\n, null as status\r\n, null as condition_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as condition_rank\r\n, null as present_on_admit_code\r\n, null as present_on_admit_description\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\condition.sql", "compiled": true, "compiled_code": "select\r\n null as condition_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as recorded_date\r\n, null as onset_date\r\n, null as resolved_date\r\n, null as status\r\n, null as condition_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as condition_rank\r\n, null as present_on_admit_code\r\n, null as present_on_admit_description\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.eligibility": {"database": "tuva", "schema": "claims_data_model", "name": "eligibility", "resource_type": "model", "package_name": "claims_data_model", "path": "eligibility.sql", "original_file_path": "models\\eligibility.sql", "unique_id": "model.claims_data_model.eligibility", "fqn": ["claims_data_model", "eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "03eccd6b65a33817b12bd12bca058bbadecfc1ff4fabad1ca3e48b91f50cfe78"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "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, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": "claims_data_model://models\\_models.yml", "build_path": "../target\\run\\claims_data_model\\models\\eligibility.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}, "database": "tuva", "schema": "claims_data_model"}, "created_at": 1693946732.002201, "relation_name": "tuva.claims_data_model.eligibility", "raw_code": "select 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\nfrom tuva.tuva_synthetic.eligibility_seed", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\eligibility.sql", "compiled": true, "compiled_code": "select 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\nfrom tuva.tuva_synthetic.eligibility_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.encounter": {"database": "tuva", "schema": "claims_data_model", "name": "encounter", "resource_type": "model", "package_name": "claims_data_model", "path": "encounter.sql", "original_file_path": "models\\encounter.sql", "unique_id": "model.claims_data_model.encounter", "fqn": ["claims_data_model", "encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "38386f9be56e5a690a7c6f584f1bbc41f291fa78751073ab2e07c29888003e3b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\encounter.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2584167, "relation_name": "tuva.claims_data_model.encounter", "raw_code": "select \r\nnull as encounter_id\r\n, null as patient_id\r\n, null as encounter_type\r\n, null as encounter_start_date\r\n, null as encounter_end_date\r\n, null as length_of_stay\r\n, null as admit_source_code\r\n, null as admit_source_description\r\n, null as admit_type_code\r\n, null as admit_type_description\r\n, null as discharge_disposition_code\r\n, null as discharge_disposition_description\r\n, null as attending_provider_id\r\n, null as facility_npi\r\n, null as primary_diagnosis_code\r\n, null as primary_diagnosis_description\r\n, null as ms_drg_code\r\n, null as ms_drg_description\r\n, null as apr_drg_code\r\n, null as apr_drg_description\r\n, null as paid_amount\r\n, null as allowed_amount\r\n, null as charge_amount\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\encounter.sql", "compiled": true, "compiled_code": "select \r\nnull as encounter_id\r\n, null as patient_id\r\n, null as encounter_type\r\n, null as encounter_start_date\r\n, null as encounter_end_date\r\n, null as length_of_stay\r\n, null as admit_source_code\r\n, null as admit_source_description\r\n, null as admit_type_code\r\n, null as admit_type_description\r\n, null as discharge_disposition_code\r\n, null as discharge_disposition_description\r\n, null as attending_provider_id\r\n, null as facility_npi\r\n, null as primary_diagnosis_code\r\n, null as primary_diagnosis_description\r\n, null as ms_drg_code\r\n, null as ms_drg_description\r\n, null as apr_drg_code\r\n, null as apr_drg_description\r\n, null as paid_amount\r\n, null as allowed_amount\r\n, null as charge_amount\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.lab_result": {"database": "tuva", "schema": "claims_data_model", "name": "lab_result", "resource_type": "model", "package_name": "claims_data_model", "path": "lab_result.sql", "original_file_path": "models\\lab_result.sql", "unique_id": "model.claims_data_model.lab_result", "fqn": ["claims_data_model", "lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "9998c0505ce23ff3469bfacc8153b9bfb16b44c1735cb90d2e616cef699876ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\lab_result.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2584167, "relation_name": "tuva.claims_data_model.lab_result", "raw_code": "select\r\nnull as lab_result_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as accession_number\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as source_component\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as normalized_component\r\n, null as status\r\n, null as result\r\n, null as result_date\r\n, null as collection_date\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as source_abnormal_flag\r\n, null as normalized_abnormal_flag\r\n, null as specimen\r\n, null as ordering_practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\lab_result.sql", "compiled": true, "compiled_code": "select\r\nnull as lab_result_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as accession_number\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as source_component\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as normalized_component\r\n, null as status\r\n, null as result\r\n, null as result_date\r\n, null as collection_date\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as source_abnormal_flag\r\n, null as normalized_abnormal_flag\r\n, null as specimen\r\n, null as ordering_practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.location": {"database": "tuva", "schema": "claims_data_model", "name": "location", "resource_type": "model", "package_name": "claims_data_model", "path": "location.sql", "original_file_path": "models\\location.sql", "unique_id": "model.claims_data_model.location", "fqn": ["claims_data_model", "location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "eeee0dcfdadf4886cb8af774bf81be2c5d9812765e5b6e3d047d85efd825a15e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\location.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2584167, "relation_name": "tuva.claims_data_model.location", "raw_code": "select\r\nnull as location_id\r\n, null as npi\r\n, null as name\r\n, null as facility_type\r\n, null as parent_organization\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\location.sql", "compiled": true, "compiled_code": "select\r\nnull as location_id\r\n, null as npi\r\n, null as name\r\n, null as facility_type\r\n, null as parent_organization\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.medical_claim": {"database": "tuva", "schema": "claims_data_model", "name": "medical_claim", "resource_type": "model", "package_name": "claims_data_model", "path": "medical_claim.sql", "original_file_path": "models\\medical_claim.sql", "unique_id": "model.claims_data_model.medical_claim", "fqn": ["claims_data_model", "medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "362a3508c230325aa78a87b1c04b5e9999374a2c132b816889e73ad5ebb9d40b"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "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, "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", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "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", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total cost of care for a claim from all payment sources (e.g. primary, beneficiary, third-party, etc)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_type": {"name": "diagnosis_code_type", "description": "Indicates the type of diagnosis code (e.g. ICD-10-CM).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": "claims_data_model://models\\_models.yml", "build_path": "../target\\run\\claims_data_model\\models\\medical_claim.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}, "database": "tuva", "schema": "claims_data_model"}, "created_at": 1693946732.048596, "relation_name": "tuva.claims_data_model.medical_claim", "raw_code": "select claim_id,\r\n claim_line_number,\r\n claim_type,\r\n patient_id,\r\n member_id,\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 total_cost_amount,\r\n allowed_amount,\r\n charge_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 tuva.tuva_synthetic.medical_claim_seed", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\medical_claim.sql", "compiled": true, "compiled_code": "select claim_id,\r\n claim_line_number,\r\n claim_type,\r\n patient_id,\r\n member_id,\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 total_cost_amount,\r\n allowed_amount,\r\n charge_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 tuva.tuva_synthetic.medical_claim_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.medication": {"database": "tuva", "schema": "claims_data_model", "name": "medication", "resource_type": "model", "package_name": "claims_data_model", "path": "medication.sql", "original_file_path": "models\\medication.sql", "unique_id": "model.claims_data_model.medication", "fqn": ["claims_data_model", "medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "7acf73c9e0217dcf225055541370a005516a33ddb58eee3395d952bc6114e23c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\medication.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2584167, "relation_name": "tuva.claims_data_model.medication", "raw_code": "select \r\nnull as medication_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as dispensing_date\r\n, null as prescribing_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as ndc_code\r\n, null as ndc_description\r\n, null as rxnorm_code\r\n, null as rxnorm_description\r\n, null as atc_code\r\n, null as atc_description\r\n, null as route\r\n, null as strength\r\n, null as quantity\r\n, null as quantity_unit\r\n, null as days_supply\r\n, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\medication.sql", "compiled": true, "compiled_code": "select \r\nnull as medication_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as dispensing_date\r\n, null as prescribing_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as ndc_code\r\n, null as ndc_description\r\n, null as rxnorm_code\r\n, null as rxnorm_description\r\n, null as atc_code\r\n, null as atc_description\r\n, null as route\r\n, null as strength\r\n, null as quantity\r\n, null as quantity_unit\r\n, null as days_supply\r\n, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.observation": {"database": "tuva", "schema": "claims_data_model", "name": "observation", "resource_type": "model", "package_name": "claims_data_model", "path": "observation.sql", "original_file_path": "models\\observation.sql", "unique_id": "model.claims_data_model.observation", "fqn": ["claims_data_model", "observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "707f27181f1bc61f20b3ccf4d69e389ec204f33765a5043ccd81be9c5fd3958a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\observation.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2661455, "relation_name": "tuva.claims_data_model.observation", "raw_code": "select\r\nnull as observation_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as panel_id\r\n, null as observation_date\r\n, null as observation_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as result\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\observation.sql", "compiled": true, "compiled_code": "select\r\nnull as observation_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as panel_id\r\n, null as observation_date\r\n, null as observation_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as result\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.patient": {"database": "tuva", "schema": "claims_data_model", "name": "patient", "resource_type": "model", "package_name": "claims_data_model", "path": "patient.sql", "original_file_path": "models\\patient.sql", "unique_id": "model.claims_data_model.patient", "fqn": ["claims_data_model", "patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "cf0d0f18e6030b9b9039410efcb37d66623b3ac5b1c91e210944828b66268bd3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\patient.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.268274, "relation_name": "tuva.claims_data_model.patient", "raw_code": "select\r\nnull as patient_id\r\n, null as first_name\r\n, null as last_name\r\n, null as sex\r\n, null as race\r\n, null as birth_date\r\n, null as death_date\r\n, null as death_flag\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as county\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\patient.sql", "compiled": true, "compiled_code": "select\r\nnull as patient_id\r\n, null as first_name\r\n, null as last_name\r\n, null as sex\r\n, null as race\r\n, null as birth_date\r\n, null as death_date\r\n, null as death_flag\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as county\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.pharmacy_claim": {"database": "tuva", "schema": "claims_data_model", "name": "pharmacy_claim", "resource_type": "model", "package_name": "claims_data_model", "path": "pharmacy_claim.sql", "original_file_path": "models\\pharmacy_claim.sql", "unique_id": "model.claims_data_model.pharmacy_claim", "fqn": ["claims_data_model", "pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "314a89f6ab7d2692cb6382cc4d6c33c8c9022365dda079ba76f6bd8b85d44229"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "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, "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", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "/terminology/medications/ndc"}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": "claims_data_model://models\\_models.yml", "build_path": "../target\\run\\claims_data_model\\models\\pharmacy_claim.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}, "database": "tuva", "schema": "claims_data_model"}, "created_at": 1693946732.0521803, "relation_name": "tuva.claims_data_model.pharmacy_claim", "raw_code": "select claim_id,\r\n claim_line_number,\r\n patient_id,\r\n member_id,\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\nfrom tuva.tuva_synthetic.pharmacy_claim_seed", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\pharmacy_claim.sql", "compiled": true, "compiled_code": "select claim_id,\r\n claim_line_number,\r\n patient_id,\r\n member_id,\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\nfrom tuva.tuva_synthetic.pharmacy_claim_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.practitioner": {"database": "tuva", "schema": "claims_data_model", "name": "practitioner", "resource_type": "model", "package_name": "claims_data_model", "path": "practitioner.sql", "original_file_path": "models\\practitioner.sql", "unique_id": "model.claims_data_model.practitioner", "fqn": ["claims_data_model", "practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "2735d624387e23bf87c3a1ee99e2912d3bf208e11aae80b379d67db7cb16572a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\practitioner.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2719524, "relation_name": "tuva.claims_data_model.practitioner", "raw_code": "select\r\n null as practitioner_id\r\n, null as npi\r\n, null as first_name\r\n, null as last_name\r\n, null as practice_affiliation\r\n, null as specialty\r\n, null as sub_specialty\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\practitioner.sql", "compiled": true, "compiled_code": "select\r\n null as practitioner_id\r\n, null as npi\r\n, null as first_name\r\n, null as last_name\r\n, null as practice_affiliation\r\n, null as specialty\r\n, null as sub_specialty\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.procedure": {"database": "tuva", "schema": "claims_data_model", "name": "procedure", "resource_type": "model", "package_name": "claims_data_model", "path": "procedure.sql", "original_file_path": "models\\procedure.sql", "unique_id": "model.claims_data_model.procedure", "fqn": ["claims_data_model", "procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "2c6aeaae8674f72dd4616bdec602f57c645cdf7fd74595b41b1c9cc82a260369"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": "../target\\run\\claims_data_model\\models\\procedure.sql", "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1693946730.2719524, "relation_name": "tuva.claims_data_model.procedure", "raw_code": "select\r\n null as procedure_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as procedure_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\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, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\procedure.sql", "compiled": true, "compiled_code": "select\r\n null as procedure_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as procedure_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\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, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "seed.claims_data_model.eligibility_seed": {"database": "tuva", "schema": "tuva_synthetic", "name": "eligibility_seed", "resource_type": "seed", "package_name": "claims_data_model", "path": "eligibility_seed.csv", "original_file_path": "../seeds\\eligibility_seed.csv", "unique_id": "seed.claims_data_model.eligibility_seed", "fqn": ["claims_data_model", "eligibility_seed"], "alias": "eligibility_seed", "checksum": {"name": "sha256", "checksum": "382ddb9efd9cc0deeda2147c03688e4c62f765a2f0a46b1997e398521615415d"}, "config": {"enabled": true, "alias": null, "schema": "tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"patient_id": "varchar(255)", "member_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)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "claims_data_model://../seeds\\_seeds.yml", "build_path": "../target\\run\\claims_data_model\\../seeds\\eligibility_seed.csv", "deferred": false, "unrendered_config": {"schema": "tuva_synthetic", "enabled": true, "column_types": {"patient_id": "varchar(255)", "member_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)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1693946732.067796, "relation_name": "tuva.tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.claims_data_model.medical_claim_seed": {"database": "tuva", "schema": "tuva_synthetic", "name": "medical_claim_seed", "resource_type": "seed", "package_name": "claims_data_model", "path": "medical_claim_seed.csv", "original_file_path": "../seeds\\medical_claim_seed.csv", "unique_id": "seed.claims_data_model.medical_claim_seed", "fqn": ["claims_data_model", "medical_claim_seed"], "alias": "medical_claim_seed", "checksum": {"name": "sha256", "checksum": "df34eb4faa196ea5362a782a15975bd2e530678d369b8598e6ea95f1804095e8"}, "config": {"enabled": true, "alias": null, "schema": "tuva_synthetic", "database": null, "tags": [], "meta": {}, "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)", "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", "total_cost_amount": "float", "allowed_amount": "float", "charge_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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "claims_data_model://../seeds\\_seeds.yml", "build_path": "../target\\run\\claims_data_model\\../seeds\\medical_claim_seed.csv", "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)", "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", "total_cost_amount": "float", "allowed_amount": "float", "charge_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": 1693946732.1222625, "relation_name": "tuva.tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.claims_data_model.pharmacy_claim_seed": {"database": "tuva", "schema": "tuva_synthetic", "name": "pharmacy_claim_seed", "resource_type": "seed", "package_name": "claims_data_model", "path": "pharmacy_claim_seed.csv", "original_file_path": "../seeds\\pharmacy_claim_seed.csv", "unique_id": "seed.claims_data_model.pharmacy_claim_seed", "fqn": ["claims_data_model", "pharmacy_claim_seed"], "alias": "pharmacy_claim_seed", "checksum": {"name": "sha256", "checksum": "4b4eced3793f948cd0cbcb1a3d690a445e3c0c2def94fb5b58a41d30df1843b6"}, "config": {"enabled": true, "alias": null, "schema": "tuva_synthetic", "database": null, "tags": [], "meta": {}, "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)", "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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "claims_data_model://../seeds\\_seeds.yml", "build_path": "../target\\run\\claims_data_model\\../seeds\\pharmacy_claim_seed.csv", "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)", "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": 1693946732.1292884, "relation_name": "tuva.tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "tuva", "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": "7be895f0727a7cac40282430cf8b0e66baa1b2443ed8d72118b007e8f5197bcb"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "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, "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, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_condition_category.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.1483421, "relation_name": "tuva.ccsr.long_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__dx_vertical_pivot"], ["ccsr__stg_core__condition"], ["ccsr__dxccsr_v2023_1_body_systems"]], "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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n),ccsr__dx_vertical_pivot as (\n \n select * from tuva.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 tuva.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 '2023-09-05 20:45:28.914033+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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}]}, "model.the_tuva_project.ccsr__long_procedure_category": {"database": "tuva", "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": "37a1eb025704337c20c1dc6f8262ed0a56ec46691ee117cd1c8846ff2af3319e"}, "config": {"enabled": true, "alias": "long_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_procedure_category.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.1624901, "relation_name": "tuva.ccsr.long_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__stg_core__procedure"], ["ccsr__procedure_category_map"]], "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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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 tuva.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 '2023-09-05 20:45:28.914033+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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "tuva", "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": "652fe2547dc8097460a36e86897ad8d57c78a8deb15bcbb906b03b0a5a89480a"}, "config": {"enabled": true, "alias": "singular_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\final\\ccsr__singular_condition_category.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "singular_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.15748, "relation_name": "tuva.ccsr.singular_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__long_condition_category"]], "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 '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.ccsr.long_condition_category\nwhere \n is_ip_default_category = true\n and condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__wide_condition_category": {"database": "tuva", "schema": "ccsr", "name": "ccsr__wide_condition_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__wide_condition_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__wide_condition_category.sql", "unique_id": "model.the_tuva_project.ccsr__wide_condition_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__wide_condition_category"], "alias": "wide_condition_category", "checksum": {"name": "sha256", "checksum": "dbc8a89328448d2913c1bf47aa1033a66c13f3504ab692132ef4a50992b60154"}, "config": {"enabled": true, "alias": "wide_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a row for each input record with a column for every CCSR condition category. \nEach column contains a value of 0, 1, 2, or 3. These values indicate:\n * 0 \\- The CCSR was not triggered by any ICD-10-CM diagnosis code on the input record.\n * 1 \\- The CCSR was triggered by only the principal (or first-listed) diagnosis on the input record.\n * 2 \\- The CCSR was triggered by both the principal (or first-listed) diagnosis and any secondary diagnosis on the input record.\n * 3 \\- The CCSR was triggered by only secondary diagnosis code(s) on the input record.\n\n This table doesn't include any category descriptions, but category and parent category descriptions\n can be found by querying the target column name against the `ccsr__dx_vertical_pivot` intermediate model. \n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\final\\ccsr__wide_condition_category.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "wide_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.1524682, "relation_name": "tuva.ccsr.wide_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set categories_list = dbt_utils.get_column_values(\r\n table=ref(\"ccsr__dx_vertical_pivot\"),\r\n column=\"ccsr_category\",\r\n order_by=\"ccsr_category\"\r\n) %}\r\n\r\n\r\nwith bool_ranks as (\r\n\r\n -- bool agg functions will reduce the long table to one row per CCSR category per encounter\r\n select \r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n case when ccsr_category like 'XXX%' then 1 else 0 end as is_excluded,\r\n min(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_only_first,\r\n max(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_first,\r\n max(cast(case when condition_rank >= 1 then 1 else 0 end as int)) as is_nth,\r\n max(cast(case when condition_rank > 1 then 1 else 0 end as int)) as not_first\r\n from {{ ref('ccsr__long_condition_category') }}\r\n {{ dbt_utils.group_by(n=5) }}\r\n\r\n), bool_logic as (\r\n\r\n select distinct\r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n -- assigns one of four values for each DXCCSR data element as per pg 25 of DXCCSR User guide v2023.1\r\n case \r\n when is_nth = 0 then 0\r\n when is_only_first = 1 and is_excluded = 0 then 1\r\n when is_first = 1 and is_nth = 1 and is_excluded = 0 then 2\r\n when not_first = 1 then 3 \r\n else -99 \r\n end as dx_code\r\n from bool_ranks \r\n\r\n)\r\n\r\nselect distinct\r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n -- pivot rows into column values for each possible CCSR category\r\n {% for category in categories_list %}\r\n sum(case when ccsr_category = '{{ category }}' then dx_code else 0 end) as dxccsr_{{ category }},\r\n {% endfor %}\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom bool_logic\r\ngroup by encounter_id, claim_id, patient_id, dxccsr_version, tuva_last_run", "language": "sql", "refs": [["ccsr__dx_vertical_pivot"], ["ccsr__long_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.group_by"], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__wide_condition_category.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith bool_ranks as (\n\n -- bool agg functions will reduce the long table to one row per CCSR category per encounter\n select \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n case when ccsr_category like 'XXX%' then 1 else 0 end as is_excluded,\n min(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_only_first,\n max(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_first,\n max(cast(case when condition_rank >= 1 then 1 else 0 end as int)) as is_nth,\n max(cast(case when condition_rank > 1 then 1 else 0 end as int)) as not_first\n from tuva.ccsr.long_condition_category\n group by 1,2,3,4,5\n\n), bool_logic as (\n\n select distinct\n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n -- assigns one of four values for each DXCCSR data element as per pg 25 of DXCCSR User guide v2023.1\n case \n when is_nth = 0 then 0\n when is_only_first = 1 and is_excluded = 0 then 1\n when is_first = 1 and is_nth = 1 and is_excluded = 0 then 2\n when not_first = 1 then 3 \n else -99 \n end as dx_code\n from bool_ranks \n\n)\n\nselect distinct\n encounter_id,\n claim_id,\n patient_id,\n -- pivot rows into column values for each possible CCSR category\n \n sum(case when ccsr_category = 'BLD001' then dx_code else 0 end) as dxccsr_BLD001,\n \n sum(case when ccsr_category = 'BLD002' then dx_code else 0 end) as dxccsr_BLD002,\n \n sum(case when ccsr_category = 'BLD003' then dx_code else 0 end) as dxccsr_BLD003,\n \n sum(case when ccsr_category = 'BLD004' then dx_code else 0 end) as dxccsr_BLD004,\n \n sum(case when ccsr_category = 'BLD005' then dx_code else 0 end) as dxccsr_BLD005,\n \n sum(case when ccsr_category = 'BLD006' then dx_code else 0 end) as dxccsr_BLD006,\n \n sum(case when ccsr_category = 'BLD007' then dx_code else 0 end) as dxccsr_BLD007,\n \n sum(case when ccsr_category = 'BLD008' then dx_code else 0 end) as dxccsr_BLD008,\n \n sum(case when ccsr_category = 'BLD009' then dx_code else 0 end) as dxccsr_BLD009,\n \n sum(case when ccsr_category = 'BLD010' then dx_code else 0 end) as dxccsr_BLD010,\n \n sum(case when ccsr_category = 'CIR001' then dx_code else 0 end) as dxccsr_CIR001,\n \n sum(case when ccsr_category = 'CIR002' then dx_code else 0 end) as dxccsr_CIR002,\n \n sum(case when ccsr_category = 'CIR003' then dx_code else 0 end) as dxccsr_CIR003,\n \n sum(case when ccsr_category = 'CIR004' then dx_code else 0 end) as dxccsr_CIR004,\n \n sum(case when ccsr_category = 'CIR005' then dx_code else 0 end) as dxccsr_CIR005,\n \n sum(case when ccsr_category = 'CIR006' then dx_code else 0 end) as dxccsr_CIR006,\n \n sum(case when ccsr_category = 'CIR007' then dx_code else 0 end) as dxccsr_CIR007,\n \n sum(case when ccsr_category = 'CIR008' then dx_code else 0 end) as dxccsr_CIR008,\n \n sum(case when ccsr_category = 'CIR009' then dx_code else 0 end) as dxccsr_CIR009,\n \n sum(case when ccsr_category = 'CIR010' then dx_code else 0 end) as dxccsr_CIR010,\n \n sum(case when ccsr_category = 'CIR011' then dx_code else 0 end) as dxccsr_CIR011,\n \n sum(case when ccsr_category = 'CIR012' then dx_code else 0 end) as dxccsr_CIR012,\n \n sum(case when ccsr_category = 'CIR013' then dx_code else 0 end) as dxccsr_CIR013,\n \n sum(case when ccsr_category = 'CIR014' then dx_code else 0 end) as dxccsr_CIR014,\n \n sum(case when ccsr_category = 'CIR015' then dx_code else 0 end) as dxccsr_CIR015,\n \n sum(case when ccsr_category = 'CIR016' then dx_code else 0 end) as dxccsr_CIR016,\n \n sum(case when ccsr_category = 'CIR017' then dx_code else 0 end) as dxccsr_CIR017,\n \n sum(case when ccsr_category = 'CIR018' then dx_code else 0 end) as dxccsr_CIR018,\n \n sum(case when ccsr_category = 'CIR019' then dx_code else 0 end) as dxccsr_CIR019,\n \n sum(case when ccsr_category = 'CIR020' then dx_code else 0 end) as dxccsr_CIR020,\n \n sum(case when ccsr_category = 'CIR021' then dx_code else 0 end) as dxccsr_CIR021,\n \n sum(case when ccsr_category = 'CIR022' then dx_code else 0 end) as dxccsr_CIR022,\n \n sum(case when ccsr_category = 'CIR023' then dx_code else 0 end) as dxccsr_CIR023,\n \n sum(case when ccsr_category = 'CIR024' then dx_code else 0 end) as dxccsr_CIR024,\n \n sum(case when ccsr_category = 'CIR025' then dx_code else 0 end) as dxccsr_CIR025,\n \n sum(case when ccsr_category = 'CIR026' then dx_code else 0 end) as dxccsr_CIR026,\n \n sum(case when ccsr_category = 'CIR027' then dx_code else 0 end) as dxccsr_CIR027,\n \n sum(case when ccsr_category = 'CIR028' then dx_code else 0 end) as dxccsr_CIR028,\n \n sum(case when ccsr_category = 'CIR029' then dx_code else 0 end) as dxccsr_CIR029,\n \n sum(case when ccsr_category = 'CIR030' then dx_code else 0 end) as dxccsr_CIR030,\n \n sum(case when ccsr_category = 'CIR031' then dx_code else 0 end) as dxccsr_CIR031,\n \n sum(case when ccsr_category = 'CIR032' then dx_code else 0 end) as dxccsr_CIR032,\n \n sum(case when ccsr_category = 'CIR033' then dx_code else 0 end) as dxccsr_CIR033,\n \n sum(case when ccsr_category = 'CIR034' then dx_code else 0 end) as dxccsr_CIR034,\n \n sum(case when ccsr_category = 'CIR035' then dx_code else 0 end) as dxccsr_CIR035,\n \n sum(case when ccsr_category = 'CIR036' then dx_code else 0 end) as dxccsr_CIR036,\n \n sum(case when ccsr_category = 'CIR037' then dx_code else 0 end) as dxccsr_CIR037,\n \n sum(case when ccsr_category = 'CIR038' then dx_code else 0 end) as dxccsr_CIR038,\n \n sum(case when ccsr_category = 'CIR039' then dx_code else 0 end) as dxccsr_CIR039,\n \n sum(case when ccsr_category = 'DEN001' then dx_code else 0 end) as dxccsr_DEN001,\n \n sum(case when ccsr_category = 'DEN002' then dx_code else 0 end) as dxccsr_DEN002,\n \n sum(case when ccsr_category = 'DEN003' then dx_code else 0 end) as dxccsr_DEN003,\n \n sum(case when ccsr_category = 'DIG001' then dx_code else 0 end) as dxccsr_DIG001,\n \n sum(case when ccsr_category = 'DIG002' then dx_code else 0 end) as dxccsr_DIG002,\n \n sum(case when ccsr_category = 'DIG003' then dx_code else 0 end) as dxccsr_DIG003,\n \n sum(case when ccsr_category = 'DIG004' then dx_code else 0 end) as dxccsr_DIG004,\n \n sum(case when ccsr_category = 'DIG005' then dx_code else 0 end) as dxccsr_DIG005,\n \n sum(case when ccsr_category = 'DIG006' then dx_code else 0 end) as dxccsr_DIG006,\n \n sum(case when ccsr_category = 'DIG007' then dx_code else 0 end) as dxccsr_DIG007,\n \n sum(case when ccsr_category = 'DIG008' then dx_code else 0 end) as dxccsr_DIG008,\n \n sum(case when ccsr_category = 'DIG009' then dx_code else 0 end) as dxccsr_DIG009,\n \n sum(case when ccsr_category = 'DIG010' then dx_code else 0 end) as dxccsr_DIG010,\n \n sum(case when ccsr_category = 'DIG011' then dx_code else 0 end) as dxccsr_DIG011,\n \n sum(case when ccsr_category = 'DIG012' then dx_code else 0 end) as dxccsr_DIG012,\n \n sum(case when ccsr_category = 'DIG013' then dx_code else 0 end) as dxccsr_DIG013,\n \n sum(case when ccsr_category = 'DIG014' then dx_code else 0 end) as dxccsr_DIG014,\n \n sum(case when ccsr_category = 'DIG015' then dx_code else 0 end) as dxccsr_DIG015,\n \n sum(case when ccsr_category = 'DIG016' then dx_code else 0 end) as dxccsr_DIG016,\n \n sum(case when ccsr_category = 'DIG017' then dx_code else 0 end) as dxccsr_DIG017,\n \n sum(case when ccsr_category = 'DIG018' then dx_code else 0 end) as dxccsr_DIG018,\n \n sum(case when ccsr_category = 'DIG019' then dx_code else 0 end) as dxccsr_DIG019,\n \n sum(case when ccsr_category = 'DIG020' then dx_code else 0 end) as dxccsr_DIG020,\n \n sum(case when ccsr_category = 'DIG021' then dx_code else 0 end) as dxccsr_DIG021,\n \n sum(case when ccsr_category = 'DIG022' then dx_code else 0 end) as dxccsr_DIG022,\n \n sum(case when ccsr_category = 'DIG023' then dx_code else 0 end) as dxccsr_DIG023,\n \n sum(case when ccsr_category = 'DIG024' then dx_code else 0 end) as dxccsr_DIG024,\n \n sum(case when ccsr_category = 'DIG025' then dx_code else 0 end) as dxccsr_DIG025,\n \n sum(case when ccsr_category = 'EAR001' then dx_code else 0 end) as dxccsr_EAR001,\n \n sum(case when ccsr_category = 'EAR002' then dx_code else 0 end) as dxccsr_EAR002,\n \n sum(case when ccsr_category = 'EAR003' then dx_code else 0 end) as dxccsr_EAR003,\n \n sum(case when ccsr_category = 'EAR004' then dx_code else 0 end) as dxccsr_EAR004,\n \n sum(case when ccsr_category = 'EAR005' then dx_code else 0 end) as dxccsr_EAR005,\n \n sum(case when ccsr_category = 'EAR006' then dx_code else 0 end) as dxccsr_EAR006,\n \n sum(case when ccsr_category = 'END001' then dx_code else 0 end) as dxccsr_END001,\n \n sum(case when ccsr_category = 'END002' then dx_code else 0 end) as dxccsr_END002,\n \n sum(case when ccsr_category = 'END003' then dx_code else 0 end) as dxccsr_END003,\n \n sum(case when ccsr_category = 'END004' then dx_code else 0 end) as dxccsr_END004,\n \n sum(case when ccsr_category = 'END005' then dx_code else 0 end) as dxccsr_END005,\n \n sum(case when ccsr_category = 'END006' then dx_code else 0 end) as dxccsr_END006,\n \n sum(case when ccsr_category = 'END007' then dx_code else 0 end) as dxccsr_END007,\n \n sum(case when ccsr_category = 'END008' then dx_code else 0 end) as dxccsr_END008,\n \n sum(case when ccsr_category = 'END009' then dx_code else 0 end) as dxccsr_END009,\n \n sum(case when ccsr_category = 'END010' then dx_code else 0 end) as dxccsr_END010,\n \n sum(case when ccsr_category = 'END011' then dx_code else 0 end) as dxccsr_END011,\n \n sum(case when ccsr_category = 'END012' then dx_code else 0 end) as dxccsr_END012,\n \n sum(case when ccsr_category = 'END013' then dx_code else 0 end) as dxccsr_END013,\n \n sum(case when ccsr_category = 'END014' then dx_code else 0 end) as dxccsr_END014,\n \n sum(case when ccsr_category = 'END015' then dx_code else 0 end) as dxccsr_END015,\n \n sum(case when ccsr_category = 'END016' then dx_code else 0 end) as dxccsr_END016,\n \n sum(case when ccsr_category = 'END017' then dx_code else 0 end) as dxccsr_END017,\n \n sum(case when ccsr_category = 'EXT001' then dx_code else 0 end) as dxccsr_EXT001,\n \n sum(case when ccsr_category = 'EXT002' then dx_code else 0 end) as dxccsr_EXT002,\n \n sum(case when ccsr_category = 'EXT003' then dx_code else 0 end) as dxccsr_EXT003,\n \n sum(case when ccsr_category = 'EXT004' then dx_code else 0 end) as dxccsr_EXT004,\n \n sum(case when ccsr_category = 'EXT005' then dx_code else 0 end) as dxccsr_EXT005,\n \n sum(case when ccsr_category = 'EXT006' then dx_code else 0 end) as dxccsr_EXT006,\n \n sum(case when ccsr_category = 'EXT007' then dx_code else 0 end) as dxccsr_EXT007,\n \n sum(case when ccsr_category = 'EXT008' then dx_code else 0 end) as dxccsr_EXT008,\n \n sum(case when ccsr_category = 'EXT009' then dx_code else 0 end) as dxccsr_EXT009,\n \n sum(case when ccsr_category = 'EXT010' then dx_code else 0 end) as dxccsr_EXT010,\n \n sum(case when ccsr_category = 'EXT011' then dx_code else 0 end) as dxccsr_EXT011,\n \n sum(case when ccsr_category = 'EXT012' then dx_code else 0 end) as dxccsr_EXT012,\n \n sum(case when ccsr_category = 'EXT013' then dx_code else 0 end) as dxccsr_EXT013,\n \n sum(case when ccsr_category = 'EXT014' then dx_code else 0 end) as dxccsr_EXT014,\n \n sum(case when ccsr_category = 'EXT015' then dx_code else 0 end) as dxccsr_EXT015,\n \n sum(case when ccsr_category = 'EXT016' then dx_code else 0 end) as dxccsr_EXT016,\n \n sum(case when ccsr_category = 'EXT017' then dx_code else 0 end) as dxccsr_EXT017,\n \n sum(case when ccsr_category = 'EXT018' then dx_code else 0 end) as dxccsr_EXT018,\n \n sum(case when ccsr_category = 'EXT019' then dx_code else 0 end) as dxccsr_EXT019,\n \n sum(case when ccsr_category = 'EXT020' then dx_code else 0 end) as dxccsr_EXT020,\n \n sum(case when ccsr_category = 'EXT021' then dx_code else 0 end) as dxccsr_EXT021,\n \n sum(case when ccsr_category = 'EXT022' then dx_code else 0 end) as dxccsr_EXT022,\n \n sum(case when ccsr_category = 'EXT023' then dx_code else 0 end) as dxccsr_EXT023,\n \n sum(case when ccsr_category = 'EXT024' then dx_code else 0 end) as dxccsr_EXT024,\n \n sum(case when ccsr_category = 'EXT025' then dx_code else 0 end) as dxccsr_EXT025,\n \n sum(case when ccsr_category = 'EXT026' then dx_code else 0 end) as dxccsr_EXT026,\n \n sum(case when ccsr_category = 'EXT027' then dx_code else 0 end) as dxccsr_EXT027,\n \n sum(case when ccsr_category = 'EXT028' then dx_code else 0 end) as dxccsr_EXT028,\n \n sum(case when ccsr_category = 'EXT029' then dx_code else 0 end) as dxccsr_EXT029,\n \n sum(case when ccsr_category = 'EXT030' then dx_code else 0 end) as dxccsr_EXT030,\n \n sum(case when ccsr_category = 'EYE001' then dx_code else 0 end) as dxccsr_EYE001,\n \n sum(case when ccsr_category = 'EYE002' then dx_code else 0 end) as dxccsr_EYE002,\n \n sum(case when ccsr_category = 'EYE003' then dx_code else 0 end) as dxccsr_EYE003,\n \n sum(case when ccsr_category = 'EYE004' then dx_code else 0 end) as dxccsr_EYE004,\n \n sum(case when ccsr_category = 'EYE005' then dx_code else 0 end) as dxccsr_EYE005,\n \n sum(case when ccsr_category = 'EYE006' then dx_code else 0 end) as dxccsr_EYE006,\n \n sum(case when ccsr_category = 'EYE007' then dx_code else 0 end) as dxccsr_EYE007,\n \n sum(case when ccsr_category = 'EYE008' then dx_code else 0 end) as dxccsr_EYE008,\n \n sum(case when ccsr_category = 'EYE009' then dx_code else 0 end) as dxccsr_EYE009,\n \n sum(case when ccsr_category = 'EYE010' then dx_code else 0 end) as dxccsr_EYE010,\n \n sum(case when ccsr_category = 'EYE011' then dx_code else 0 end) as dxccsr_EYE011,\n \n sum(case when ccsr_category = 'EYE012' then dx_code else 0 end) as dxccsr_EYE012,\n \n sum(case when ccsr_category = 'FAC001' then dx_code else 0 end) as dxccsr_FAC001,\n \n sum(case when ccsr_category = 'FAC002' then dx_code else 0 end) as dxccsr_FAC002,\n \n sum(case when ccsr_category = 'FAC003' then dx_code else 0 end) as dxccsr_FAC003,\n \n sum(case when ccsr_category = 'FAC004' then dx_code else 0 end) as dxccsr_FAC004,\n \n sum(case when ccsr_category = 'FAC005' then dx_code else 0 end) as dxccsr_FAC005,\n \n sum(case when ccsr_category = 'FAC006' then dx_code else 0 end) as dxccsr_FAC006,\n \n sum(case when ccsr_category = 'FAC007' then dx_code else 0 end) as dxccsr_FAC007,\n \n sum(case when ccsr_category = 'FAC008' then dx_code else 0 end) as dxccsr_FAC008,\n \n sum(case when ccsr_category = 'FAC009' then dx_code else 0 end) as dxccsr_FAC009,\n \n sum(case when ccsr_category = 'FAC010' then dx_code else 0 end) as dxccsr_FAC010,\n \n sum(case when ccsr_category = 'FAC011' then dx_code else 0 end) as dxccsr_FAC011,\n \n sum(case when ccsr_category = 'FAC012' then dx_code else 0 end) as dxccsr_FAC012,\n \n sum(case when ccsr_category = 'FAC013' then dx_code else 0 end) as dxccsr_FAC013,\n \n sum(case when ccsr_category = 'FAC014' then dx_code else 0 end) as dxccsr_FAC014,\n \n sum(case when ccsr_category = 'FAC015' then dx_code else 0 end) as dxccsr_FAC015,\n \n sum(case when ccsr_category = 'FAC016' then dx_code else 0 end) as dxccsr_FAC016,\n \n sum(case when ccsr_category = 'FAC017' then dx_code else 0 end) as dxccsr_FAC017,\n \n sum(case when ccsr_category = 'FAC018' then dx_code else 0 end) as dxccsr_FAC018,\n \n sum(case when ccsr_category = 'FAC019' then dx_code else 0 end) as dxccsr_FAC019,\n \n sum(case when ccsr_category = 'FAC020' then dx_code else 0 end) as dxccsr_FAC020,\n \n sum(case when ccsr_category = 'FAC021' then dx_code else 0 end) as dxccsr_FAC021,\n \n sum(case when ccsr_category = 'FAC022' then dx_code else 0 end) as dxccsr_FAC022,\n \n sum(case when ccsr_category = 'FAC023' then dx_code else 0 end) as dxccsr_FAC023,\n \n sum(case when ccsr_category = 'FAC024' then dx_code else 0 end) as dxccsr_FAC024,\n \n sum(case when ccsr_category = 'FAC025' then dx_code else 0 end) as dxccsr_FAC025,\n \n sum(case when ccsr_category = 'GEN001' then dx_code else 0 end) as dxccsr_GEN001,\n \n sum(case when ccsr_category = 'GEN002' then dx_code else 0 end) as dxccsr_GEN002,\n \n sum(case when ccsr_category = 'GEN003' then dx_code else 0 end) as dxccsr_GEN003,\n \n sum(case when ccsr_category = 'GEN004' then dx_code else 0 end) as dxccsr_GEN004,\n \n sum(case when ccsr_category = 'GEN005' then dx_code else 0 end) as dxccsr_GEN005,\n \n sum(case when ccsr_category = 'GEN006' then dx_code else 0 end) as dxccsr_GEN006,\n \n sum(case when ccsr_category = 'GEN007' then dx_code else 0 end) as dxccsr_GEN007,\n \n sum(case when ccsr_category = 'GEN008' then dx_code else 0 end) as dxccsr_GEN008,\n \n sum(case when ccsr_category = 'GEN009' then dx_code else 0 end) as dxccsr_GEN009,\n \n sum(case when ccsr_category = 'GEN010' then dx_code else 0 end) as dxccsr_GEN010,\n \n sum(case when ccsr_category = 'GEN011' then dx_code else 0 end) as dxccsr_GEN011,\n \n sum(case when ccsr_category = 'GEN012' then dx_code else 0 end) as dxccsr_GEN012,\n \n sum(case when ccsr_category = 'GEN013' then dx_code else 0 end) as dxccsr_GEN013,\n \n sum(case when ccsr_category = 'GEN014' then dx_code else 0 end) as dxccsr_GEN014,\n \n sum(case when ccsr_category = 'GEN015' then dx_code else 0 end) as dxccsr_GEN015,\n \n sum(case when ccsr_category = 'GEN016' then dx_code else 0 end) as dxccsr_GEN016,\n \n sum(case when ccsr_category = 'GEN017' then dx_code else 0 end) as dxccsr_GEN017,\n \n sum(case when ccsr_category = 'GEN018' then dx_code else 0 end) as dxccsr_GEN018,\n \n sum(case when ccsr_category = 'GEN019' then dx_code else 0 end) as dxccsr_GEN019,\n \n sum(case when ccsr_category = 'GEN020' then dx_code else 0 end) as dxccsr_GEN020,\n \n sum(case when ccsr_category = 'GEN021' then dx_code else 0 end) as dxccsr_GEN021,\n \n sum(case when ccsr_category = 'GEN022' then dx_code else 0 end) as dxccsr_GEN022,\n \n sum(case when ccsr_category = 'GEN023' then dx_code else 0 end) as dxccsr_GEN023,\n \n sum(case when ccsr_category = 'GEN024' then dx_code else 0 end) as dxccsr_GEN024,\n \n sum(case when ccsr_category = 'GEN025' then dx_code else 0 end) as dxccsr_GEN025,\n \n sum(case when ccsr_category = 'GEN026' then dx_code else 0 end) as dxccsr_GEN026,\n \n sum(case when ccsr_category = 'INF001' then dx_code else 0 end) as dxccsr_INF001,\n \n sum(case when ccsr_category = 'INF002' then dx_code else 0 end) as dxccsr_INF002,\n \n sum(case when ccsr_category = 'INF003' then dx_code else 0 end) as dxccsr_INF003,\n \n sum(case when ccsr_category = 'INF004' then dx_code else 0 end) as dxccsr_INF004,\n \n sum(case when ccsr_category = 'INF005' then dx_code else 0 end) as dxccsr_INF005,\n \n sum(case when ccsr_category = 'INF006' then dx_code else 0 end) as dxccsr_INF006,\n \n sum(case when ccsr_category = 'INF007' then dx_code else 0 end) as dxccsr_INF007,\n \n sum(case when ccsr_category = 'INF008' then dx_code else 0 end) as dxccsr_INF008,\n \n sum(case when ccsr_category = 'INF009' then dx_code else 0 end) as dxccsr_INF009,\n \n sum(case when ccsr_category = 'INF010' then dx_code else 0 end) as dxccsr_INF010,\n \n sum(case when ccsr_category = 'INF011' then dx_code else 0 end) as dxccsr_INF011,\n \n sum(case when ccsr_category = 'INF012' then dx_code else 0 end) as dxccsr_INF012,\n \n sum(case when ccsr_category = 'INJ001' then dx_code else 0 end) as dxccsr_INJ001,\n \n sum(case when ccsr_category = 'INJ002' then dx_code else 0 end) as dxccsr_INJ002,\n \n sum(case when ccsr_category = 'INJ003' then dx_code else 0 end) as dxccsr_INJ003,\n \n sum(case when ccsr_category = 'INJ004' then dx_code else 0 end) as dxccsr_INJ004,\n \n sum(case when ccsr_category = 'INJ005' then dx_code else 0 end) as dxccsr_INJ005,\n \n sum(case when ccsr_category = 'INJ006' then dx_code else 0 end) as dxccsr_INJ006,\n \n sum(case when ccsr_category = 'INJ007' then dx_code else 0 end) as dxccsr_INJ007,\n \n sum(case when ccsr_category = 'INJ008' then dx_code else 0 end) as dxccsr_INJ008,\n \n sum(case when ccsr_category = 'INJ009' then dx_code else 0 end) as dxccsr_INJ009,\n \n sum(case when ccsr_category = 'INJ010' then dx_code else 0 end) as dxccsr_INJ010,\n \n sum(case when ccsr_category = 'INJ011' then dx_code else 0 end) as dxccsr_INJ011,\n \n sum(case when ccsr_category = 'INJ012' then dx_code else 0 end) as dxccsr_INJ012,\n \n sum(case when ccsr_category = 'INJ013' then dx_code else 0 end) as dxccsr_INJ013,\n \n sum(case when ccsr_category = 'INJ014' then dx_code else 0 end) as dxccsr_INJ014,\n \n sum(case when ccsr_category = 'INJ015' then dx_code else 0 end) as dxccsr_INJ015,\n \n sum(case when ccsr_category = 'INJ016' then dx_code else 0 end) as dxccsr_INJ016,\n \n sum(case when ccsr_category = 'INJ017' then dx_code else 0 end) as dxccsr_INJ017,\n \n sum(case when ccsr_category = 'INJ018' then dx_code else 0 end) as dxccsr_INJ018,\n \n sum(case when ccsr_category = 'INJ019' then dx_code else 0 end) as dxccsr_INJ019,\n \n sum(case when ccsr_category = 'INJ020' then dx_code else 0 end) as dxccsr_INJ020,\n \n sum(case when ccsr_category = 'INJ021' then dx_code else 0 end) as dxccsr_INJ021,\n \n sum(case when ccsr_category = 'INJ022' then dx_code else 0 end) as dxccsr_INJ022,\n \n sum(case when ccsr_category = 'INJ023' then dx_code else 0 end) as dxccsr_INJ023,\n \n sum(case when ccsr_category = 'INJ024' then dx_code else 0 end) as dxccsr_INJ024,\n \n sum(case when ccsr_category = 'INJ025' then dx_code else 0 end) as dxccsr_INJ025,\n \n sum(case when ccsr_category = 'INJ026' then dx_code else 0 end) as dxccsr_INJ026,\n \n sum(case when ccsr_category = 'INJ027' then dx_code else 0 end) as dxccsr_INJ027,\n \n sum(case when ccsr_category = 'INJ028' then dx_code else 0 end) as dxccsr_INJ028,\n \n sum(case when ccsr_category = 'INJ029' then dx_code else 0 end) as dxccsr_INJ029,\n \n sum(case when ccsr_category = 'INJ030' then dx_code else 0 end) as dxccsr_INJ030,\n \n sum(case when ccsr_category = 'INJ031' then dx_code else 0 end) as dxccsr_INJ031,\n \n sum(case when ccsr_category = 'INJ032' then dx_code else 0 end) as dxccsr_INJ032,\n \n sum(case when ccsr_category = 'INJ033' then dx_code else 0 end) as dxccsr_INJ033,\n \n sum(case when ccsr_category = 'INJ034' then dx_code else 0 end) as dxccsr_INJ034,\n \n sum(case when ccsr_category = 'INJ035' then dx_code else 0 end) as dxccsr_INJ035,\n \n sum(case when ccsr_category = 'INJ036' then dx_code else 0 end) as dxccsr_INJ036,\n \n sum(case when ccsr_category = 'INJ037' then dx_code else 0 end) as dxccsr_INJ037,\n \n sum(case when ccsr_category = 'INJ038' then dx_code else 0 end) as dxccsr_INJ038,\n \n sum(case when ccsr_category = 'INJ039' then dx_code else 0 end) as dxccsr_INJ039,\n \n sum(case when ccsr_category = 'INJ040' then dx_code else 0 end) as dxccsr_INJ040,\n \n sum(case when ccsr_category = 'INJ041' then dx_code else 0 end) as dxccsr_INJ041,\n \n sum(case when ccsr_category = 'INJ042' then dx_code else 0 end) as dxccsr_INJ042,\n \n sum(case when ccsr_category = 'INJ043' then dx_code else 0 end) as dxccsr_INJ043,\n \n sum(case when ccsr_category = 'INJ044' then dx_code else 0 end) as dxccsr_INJ044,\n \n sum(case when ccsr_category = 'INJ045' then dx_code else 0 end) as dxccsr_INJ045,\n \n sum(case when ccsr_category = 'INJ046' then dx_code else 0 end) as dxccsr_INJ046,\n \n sum(case when ccsr_category = 'INJ047' then dx_code else 0 end) as dxccsr_INJ047,\n \n sum(case when ccsr_category = 'INJ048' then dx_code else 0 end) as dxccsr_INJ048,\n \n sum(case when ccsr_category = 'INJ049' then dx_code else 0 end) as dxccsr_INJ049,\n \n sum(case when ccsr_category = 'INJ050' then dx_code else 0 end) as dxccsr_INJ050,\n \n sum(case when ccsr_category = 'INJ051' then dx_code else 0 end) as dxccsr_INJ051,\n \n sum(case when ccsr_category = 'INJ052' then dx_code else 0 end) as dxccsr_INJ052,\n \n sum(case when ccsr_category = 'INJ053' then dx_code else 0 end) as dxccsr_INJ053,\n \n sum(case when ccsr_category = 'INJ054' then dx_code else 0 end) as dxccsr_INJ054,\n \n sum(case when ccsr_category = 'INJ055' then dx_code else 0 end) as dxccsr_INJ055,\n \n sum(case when ccsr_category = 'INJ056' then dx_code else 0 end) as dxccsr_INJ056,\n \n sum(case when ccsr_category = 'INJ057' then dx_code else 0 end) as dxccsr_INJ057,\n \n sum(case when ccsr_category = 'INJ058' then dx_code else 0 end) as dxccsr_INJ058,\n \n sum(case when ccsr_category = 'INJ059' then dx_code else 0 end) as dxccsr_INJ059,\n \n sum(case when ccsr_category = 'INJ060' then dx_code else 0 end) as dxccsr_INJ060,\n \n sum(case when ccsr_category = 'INJ061' then dx_code else 0 end) as dxccsr_INJ061,\n \n sum(case when ccsr_category = 'INJ062' then dx_code else 0 end) as dxccsr_INJ062,\n \n sum(case when ccsr_category = 'INJ063' then dx_code else 0 end) as dxccsr_INJ063,\n \n sum(case when ccsr_category = 'INJ064' then dx_code else 0 end) as dxccsr_INJ064,\n \n sum(case when ccsr_category = 'INJ065' then dx_code else 0 end) as dxccsr_INJ065,\n \n sum(case when ccsr_category = 'INJ066' then dx_code else 0 end) as dxccsr_INJ066,\n \n sum(case when ccsr_category = 'INJ067' then dx_code else 0 end) as dxccsr_INJ067,\n \n sum(case when ccsr_category = 'INJ068' then dx_code else 0 end) as dxccsr_INJ068,\n \n sum(case when ccsr_category = 'INJ069' then dx_code else 0 end) as dxccsr_INJ069,\n \n sum(case when ccsr_category = 'INJ070' then dx_code else 0 end) as dxccsr_INJ070,\n \n sum(case when ccsr_category = 'INJ071' then dx_code else 0 end) as dxccsr_INJ071,\n \n sum(case when ccsr_category = 'INJ072' then dx_code else 0 end) as dxccsr_INJ072,\n \n sum(case when ccsr_category = 'INJ073' then dx_code else 0 end) as dxccsr_INJ073,\n \n sum(case when ccsr_category = 'INJ074' then dx_code else 0 end) as dxccsr_INJ074,\n \n sum(case when ccsr_category = 'INJ075' then dx_code else 0 end) as dxccsr_INJ075,\n \n sum(case when ccsr_category = 'INJ076' then dx_code else 0 end) as dxccsr_INJ076,\n \n sum(case when ccsr_category = 'MAL001' then dx_code else 0 end) as dxccsr_MAL001,\n \n sum(case when ccsr_category = 'MAL002' then dx_code else 0 end) as dxccsr_MAL002,\n \n sum(case when ccsr_category = 'MAL003' then dx_code else 0 end) as dxccsr_MAL003,\n \n sum(case when ccsr_category = 'MAL004' then dx_code else 0 end) as dxccsr_MAL004,\n \n sum(case when ccsr_category = 'MAL005' then dx_code else 0 end) as dxccsr_MAL005,\n \n sum(case when ccsr_category = 'MAL006' then dx_code else 0 end) as dxccsr_MAL006,\n \n sum(case when ccsr_category = 'MAL007' then dx_code else 0 end) as dxccsr_MAL007,\n \n sum(case when ccsr_category = 'MAL008' then dx_code else 0 end) as dxccsr_MAL008,\n \n sum(case when ccsr_category = 'MAL009' then dx_code else 0 end) as dxccsr_MAL009,\n \n sum(case when ccsr_category = 'MAL010' then dx_code else 0 end) as dxccsr_MAL010,\n \n sum(case when ccsr_category = 'MBD001' then dx_code else 0 end) as dxccsr_MBD001,\n \n sum(case when ccsr_category = 'MBD002' then dx_code else 0 end) as dxccsr_MBD002,\n \n sum(case when ccsr_category = 'MBD003' then dx_code else 0 end) as dxccsr_MBD003,\n \n sum(case when ccsr_category = 'MBD004' then dx_code else 0 end) as dxccsr_MBD004,\n \n sum(case when ccsr_category = 'MBD005' then dx_code else 0 end) as dxccsr_MBD005,\n \n sum(case when ccsr_category = 'MBD006' then dx_code else 0 end) as dxccsr_MBD006,\n \n sum(case when ccsr_category = 'MBD007' then dx_code else 0 end) as dxccsr_MBD007,\n \n sum(case when ccsr_category = 'MBD008' then dx_code else 0 end) as dxccsr_MBD008,\n \n sum(case when ccsr_category = 'MBD009' then dx_code else 0 end) as dxccsr_MBD009,\n \n sum(case when ccsr_category = 'MBD010' then dx_code else 0 end) as dxccsr_MBD010,\n \n sum(case when ccsr_category = 'MBD011' then dx_code else 0 end) as dxccsr_MBD011,\n \n sum(case when ccsr_category = 'MBD012' then dx_code else 0 end) as dxccsr_MBD012,\n \n sum(case when ccsr_category = 'MBD013' then dx_code else 0 end) as dxccsr_MBD013,\n \n sum(case when ccsr_category = 'MBD014' then dx_code else 0 end) as dxccsr_MBD014,\n \n sum(case when ccsr_category = 'MBD017' then dx_code else 0 end) as dxccsr_MBD017,\n \n sum(case when ccsr_category = 'MBD018' then dx_code else 0 end) as dxccsr_MBD018,\n \n sum(case when ccsr_category = 'MBD019' then dx_code else 0 end) as dxccsr_MBD019,\n \n sum(case when ccsr_category = 'MBD020' then dx_code else 0 end) as dxccsr_MBD020,\n \n sum(case when ccsr_category = 'MBD021' then dx_code else 0 end) as dxccsr_MBD021,\n \n sum(case when ccsr_category = 'MBD022' then dx_code else 0 end) as dxccsr_MBD022,\n \n sum(case when ccsr_category = 'MBD023' then dx_code else 0 end) as dxccsr_MBD023,\n \n sum(case when ccsr_category = 'MBD024' then dx_code else 0 end) as dxccsr_MBD024,\n \n sum(case when ccsr_category = 'MBD025' then dx_code else 0 end) as dxccsr_MBD025,\n \n sum(case when ccsr_category = 'MBD026' then dx_code else 0 end) as dxccsr_MBD026,\n \n sum(case when ccsr_category = 'MBD027' then dx_code else 0 end) as dxccsr_MBD027,\n \n sum(case when ccsr_category = 'MBD028' then dx_code else 0 end) as dxccsr_MBD028,\n \n sum(case when ccsr_category = 'MBD029' then dx_code else 0 end) as dxccsr_MBD029,\n \n sum(case when ccsr_category = 'MBD030' then dx_code else 0 end) as dxccsr_MBD030,\n \n sum(case when ccsr_category = 'MBD031' then dx_code else 0 end) as dxccsr_MBD031,\n \n sum(case when ccsr_category = 'MBD032' then dx_code else 0 end) as dxccsr_MBD032,\n \n sum(case when ccsr_category = 'MBD033' then dx_code else 0 end) as dxccsr_MBD033,\n \n sum(case when ccsr_category = 'MBD034' then dx_code else 0 end) as dxccsr_MBD034,\n \n sum(case when ccsr_category = 'MUS001' then dx_code else 0 end) as dxccsr_MUS001,\n \n sum(case when ccsr_category = 'MUS002' then dx_code else 0 end) as dxccsr_MUS002,\n \n sum(case when ccsr_category = 'MUS003' then dx_code else 0 end) as dxccsr_MUS003,\n \n sum(case when ccsr_category = 'MUS004' then dx_code else 0 end) as dxccsr_MUS004,\n \n sum(case when ccsr_category = 'MUS005' then dx_code else 0 end) as dxccsr_MUS005,\n \n sum(case when ccsr_category = 'MUS006' then dx_code else 0 end) as dxccsr_MUS006,\n \n sum(case when ccsr_category = 'MUS007' then dx_code else 0 end) as dxccsr_MUS007,\n \n sum(case when ccsr_category = 'MUS008' then dx_code else 0 end) as dxccsr_MUS008,\n \n sum(case when ccsr_category = 'MUS009' then dx_code else 0 end) as dxccsr_MUS009,\n \n sum(case when ccsr_category = 'MUS010' then dx_code else 0 end) as dxccsr_MUS010,\n \n sum(case when ccsr_category = 'MUS011' then dx_code else 0 end) as dxccsr_MUS011,\n \n sum(case when ccsr_category = 'MUS012' then dx_code else 0 end) as dxccsr_MUS012,\n \n sum(case when ccsr_category = 'MUS013' then dx_code else 0 end) as dxccsr_MUS013,\n \n sum(case when ccsr_category = 'MUS014' then dx_code else 0 end) as dxccsr_MUS014,\n \n sum(case when ccsr_category = 'MUS015' then dx_code else 0 end) as dxccsr_MUS015,\n \n sum(case when ccsr_category = 'MUS016' then dx_code else 0 end) as dxccsr_MUS016,\n \n sum(case when ccsr_category = 'MUS017' then dx_code else 0 end) as dxccsr_MUS017,\n \n sum(case when ccsr_category = 'MUS018' then dx_code else 0 end) as dxccsr_MUS018,\n \n sum(case when ccsr_category = 'MUS019' then dx_code else 0 end) as dxccsr_MUS019,\n \n sum(case when ccsr_category = 'MUS020' then dx_code else 0 end) as dxccsr_MUS020,\n \n sum(case when ccsr_category = 'MUS021' then dx_code else 0 end) as dxccsr_MUS021,\n \n sum(case when ccsr_category = 'MUS022' then dx_code else 0 end) as dxccsr_MUS022,\n \n sum(case when ccsr_category = 'MUS023' then dx_code else 0 end) as dxccsr_MUS023,\n \n sum(case when ccsr_category = 'MUS024' then dx_code else 0 end) as dxccsr_MUS024,\n \n sum(case when ccsr_category = 'MUS025' then dx_code else 0 end) as dxccsr_MUS025,\n \n sum(case when ccsr_category = 'MUS026' then dx_code else 0 end) as dxccsr_MUS026,\n \n sum(case when ccsr_category = 'MUS027' then dx_code else 0 end) as dxccsr_MUS027,\n \n sum(case when ccsr_category = 'MUS028' then dx_code else 0 end) as dxccsr_MUS028,\n \n sum(case when ccsr_category = 'MUS029' then dx_code else 0 end) as dxccsr_MUS029,\n \n sum(case when ccsr_category = 'MUS030' then dx_code else 0 end) as dxccsr_MUS030,\n \n sum(case when ccsr_category = 'MUS031' then dx_code else 0 end) as dxccsr_MUS031,\n \n sum(case when ccsr_category = 'MUS032' then dx_code else 0 end) as dxccsr_MUS032,\n \n sum(case when ccsr_category = 'MUS033' then dx_code else 0 end) as dxccsr_MUS033,\n \n sum(case when ccsr_category = 'MUS034' then dx_code else 0 end) as dxccsr_MUS034,\n \n sum(case when ccsr_category = 'MUS035' then dx_code else 0 end) as dxccsr_MUS035,\n \n sum(case when ccsr_category = 'MUS036' then dx_code else 0 end) as dxccsr_MUS036,\n \n sum(case when ccsr_category = 'MUS037' then dx_code else 0 end) as dxccsr_MUS037,\n \n sum(case when ccsr_category = 'MUS038' then dx_code else 0 end) as dxccsr_MUS038,\n \n sum(case when ccsr_category = 'NEO001' then dx_code else 0 end) as dxccsr_NEO001,\n \n sum(case when ccsr_category = 'NEO002' then dx_code else 0 end) as dxccsr_NEO002,\n \n sum(case when ccsr_category = 'NEO003' then dx_code else 0 end) as dxccsr_NEO003,\n \n sum(case when ccsr_category = 'NEO004' then dx_code else 0 end) as dxccsr_NEO004,\n \n sum(case when ccsr_category = 'NEO005' then dx_code else 0 end) as dxccsr_NEO005,\n \n sum(case when ccsr_category = 'NEO006' then dx_code else 0 end) as dxccsr_NEO006,\n \n sum(case when ccsr_category = 'NEO007' then dx_code else 0 end) as dxccsr_NEO007,\n \n sum(case when ccsr_category = 'NEO008' then dx_code else 0 end) as dxccsr_NEO008,\n \n sum(case when ccsr_category = 'NEO009' then dx_code else 0 end) as dxccsr_NEO009,\n \n sum(case when ccsr_category = 'NEO010' then dx_code else 0 end) as dxccsr_NEO010,\n \n sum(case when ccsr_category = 'NEO011' then dx_code else 0 end) as dxccsr_NEO011,\n \n sum(case when ccsr_category = 'NEO012' then dx_code else 0 end) as dxccsr_NEO012,\n \n sum(case when ccsr_category = 'NEO013' then dx_code else 0 end) as dxccsr_NEO013,\n \n sum(case when ccsr_category = 'NEO014' then dx_code else 0 end) as dxccsr_NEO014,\n \n sum(case when ccsr_category = 'NEO015' then dx_code else 0 end) as dxccsr_NEO015,\n \n sum(case when ccsr_category = 'NEO016' then dx_code else 0 end) as dxccsr_NEO016,\n \n sum(case when ccsr_category = 'NEO017' then dx_code else 0 end) as dxccsr_NEO017,\n \n sum(case when ccsr_category = 'NEO018' then dx_code else 0 end) as dxccsr_NEO018,\n \n sum(case when ccsr_category = 'NEO019' then dx_code else 0 end) as dxccsr_NEO019,\n \n sum(case when ccsr_category = 'NEO020' then dx_code else 0 end) as dxccsr_NEO020,\n \n sum(case when ccsr_category = 'NEO021' then dx_code else 0 end) as dxccsr_NEO021,\n \n sum(case when ccsr_category = 'NEO022' then dx_code else 0 end) as dxccsr_NEO022,\n \n sum(case when ccsr_category = 'NEO023' then dx_code else 0 end) as dxccsr_NEO023,\n \n sum(case when ccsr_category = 'NEO024' then dx_code else 0 end) as dxccsr_NEO024,\n \n sum(case when ccsr_category = 'NEO025' then dx_code else 0 end) as dxccsr_NEO025,\n \n sum(case when ccsr_category = 'NEO026' then dx_code else 0 end) as dxccsr_NEO026,\n \n sum(case when ccsr_category = 'NEO027' then dx_code else 0 end) as dxccsr_NEO027,\n \n sum(case when ccsr_category = 'NEO028' then dx_code else 0 end) as dxccsr_NEO028,\n \n sum(case when ccsr_category = 'NEO029' then dx_code else 0 end) as dxccsr_NEO029,\n \n sum(case when ccsr_category = 'NEO030' then dx_code else 0 end) as dxccsr_NEO030,\n \n sum(case when ccsr_category = 'NEO031' then dx_code else 0 end) as dxccsr_NEO031,\n \n sum(case when ccsr_category = 'NEO032' then dx_code else 0 end) as dxccsr_NEO032,\n \n sum(case when ccsr_category = 'NEO033' then dx_code else 0 end) as dxccsr_NEO033,\n \n sum(case when ccsr_category = 'NEO034' then dx_code else 0 end) as dxccsr_NEO034,\n \n sum(case when ccsr_category = 'NEO035' then dx_code else 0 end) as dxccsr_NEO035,\n \n sum(case when ccsr_category = 'NEO036' then dx_code else 0 end) as dxccsr_NEO036,\n \n sum(case when ccsr_category = 'NEO037' then dx_code else 0 end) as dxccsr_NEO037,\n \n sum(case when ccsr_category = 'NEO038' then dx_code else 0 end) as dxccsr_NEO038,\n \n sum(case when ccsr_category = 'NEO039' then dx_code else 0 end) as dxccsr_NEO039,\n \n sum(case when ccsr_category = 'NEO040' then dx_code else 0 end) as dxccsr_NEO040,\n \n sum(case when ccsr_category = 'NEO041' then dx_code else 0 end) as dxccsr_NEO041,\n \n sum(case when ccsr_category = 'NEO042' then dx_code else 0 end) as dxccsr_NEO042,\n \n sum(case when ccsr_category = 'NEO043' then dx_code else 0 end) as dxccsr_NEO043,\n \n sum(case when ccsr_category = 'NEO044' then dx_code else 0 end) as dxccsr_NEO044,\n \n sum(case when ccsr_category = 'NEO045' then dx_code else 0 end) as dxccsr_NEO045,\n \n sum(case when ccsr_category = 'NEO046' then dx_code else 0 end) as dxccsr_NEO046,\n \n sum(case when ccsr_category = 'NEO047' then dx_code else 0 end) as dxccsr_NEO047,\n \n sum(case when ccsr_category = 'NEO048' then dx_code else 0 end) as dxccsr_NEO048,\n \n sum(case when ccsr_category = 'NEO049' then dx_code else 0 end) as dxccsr_NEO049,\n \n sum(case when ccsr_category = 'NEO050' then dx_code else 0 end) as dxccsr_NEO050,\n \n sum(case when ccsr_category = 'NEO051' then dx_code else 0 end) as dxccsr_NEO051,\n \n sum(case when ccsr_category = 'NEO052' then dx_code else 0 end) as dxccsr_NEO052,\n \n sum(case when ccsr_category = 'NEO053' then dx_code else 0 end) as dxccsr_NEO053,\n \n sum(case when ccsr_category = 'NEO054' then dx_code else 0 end) as dxccsr_NEO054,\n \n sum(case when ccsr_category = 'NEO055' then dx_code else 0 end) as dxccsr_NEO055,\n \n sum(case when ccsr_category = 'NEO056' then dx_code else 0 end) as dxccsr_NEO056,\n \n sum(case when ccsr_category = 'NEO057' then dx_code else 0 end) as dxccsr_NEO057,\n \n sum(case when ccsr_category = 'NEO058' then dx_code else 0 end) as dxccsr_NEO058,\n \n sum(case when ccsr_category = 'NEO059' then dx_code else 0 end) as dxccsr_NEO059,\n \n sum(case when ccsr_category = 'NEO060' then dx_code else 0 end) as dxccsr_NEO060,\n \n sum(case when ccsr_category = 'NEO061' then dx_code else 0 end) as dxccsr_NEO061,\n \n sum(case when ccsr_category = 'NEO062' then dx_code else 0 end) as dxccsr_NEO062,\n \n sum(case when ccsr_category = 'NEO063' then dx_code else 0 end) as dxccsr_NEO063,\n \n sum(case when ccsr_category = 'NEO064' then dx_code else 0 end) as dxccsr_NEO064,\n \n sum(case when ccsr_category = 'NEO065' then dx_code else 0 end) as dxccsr_NEO065,\n \n sum(case when ccsr_category = 'NEO066' then dx_code else 0 end) as dxccsr_NEO066,\n \n sum(case when ccsr_category = 'NEO067' then dx_code else 0 end) as dxccsr_NEO067,\n \n sum(case when ccsr_category = 'NEO068' then dx_code else 0 end) as dxccsr_NEO068,\n \n sum(case when ccsr_category = 'NEO069' then dx_code else 0 end) as dxccsr_NEO069,\n \n sum(case when ccsr_category = 'NEO070' then dx_code else 0 end) as dxccsr_NEO070,\n \n sum(case when ccsr_category = 'NEO071' then dx_code else 0 end) as dxccsr_NEO071,\n \n sum(case when ccsr_category = 'NEO072' then dx_code else 0 end) as dxccsr_NEO072,\n \n sum(case when ccsr_category = 'NEO073' then dx_code else 0 end) as dxccsr_NEO073,\n \n sum(case when ccsr_category = 'NEO074' then dx_code else 0 end) as dxccsr_NEO074,\n \n sum(case when ccsr_category = 'NVS001' then dx_code else 0 end) as dxccsr_NVS001,\n \n sum(case when ccsr_category = 'NVS002' then dx_code else 0 end) as dxccsr_NVS002,\n \n sum(case when ccsr_category = 'NVS003' then dx_code else 0 end) as dxccsr_NVS003,\n \n sum(case when ccsr_category = 'NVS004' then dx_code else 0 end) as dxccsr_NVS004,\n \n sum(case when ccsr_category = 'NVS005' then dx_code else 0 end) as dxccsr_NVS005,\n \n sum(case when ccsr_category = 'NVS006' then dx_code else 0 end) as dxccsr_NVS006,\n \n sum(case when ccsr_category = 'NVS007' then dx_code else 0 end) as dxccsr_NVS007,\n \n sum(case when ccsr_category = 'NVS008' then dx_code else 0 end) as dxccsr_NVS008,\n \n sum(case when ccsr_category = 'NVS009' then dx_code else 0 end) as dxccsr_NVS009,\n \n sum(case when ccsr_category = 'NVS010' then dx_code else 0 end) as dxccsr_NVS010,\n \n sum(case when ccsr_category = 'NVS011' then dx_code else 0 end) as dxccsr_NVS011,\n \n sum(case when ccsr_category = 'NVS012' then dx_code else 0 end) as dxccsr_NVS012,\n \n sum(case when ccsr_category = 'NVS013' then dx_code else 0 end) as dxccsr_NVS013,\n \n sum(case when ccsr_category = 'NVS014' then dx_code else 0 end) as dxccsr_NVS014,\n \n sum(case when ccsr_category = 'NVS015' then dx_code else 0 end) as dxccsr_NVS015,\n \n sum(case when ccsr_category = 'NVS016' then dx_code else 0 end) as dxccsr_NVS016,\n \n sum(case when ccsr_category = 'NVS017' then dx_code else 0 end) as dxccsr_NVS017,\n \n sum(case when ccsr_category = 'NVS018' then dx_code else 0 end) as dxccsr_NVS018,\n \n sum(case when ccsr_category = 'NVS019' then dx_code else 0 end) as dxccsr_NVS019,\n \n sum(case when ccsr_category = 'NVS020' then dx_code else 0 end) as dxccsr_NVS020,\n \n sum(case when ccsr_category = 'NVS021' then dx_code else 0 end) as dxccsr_NVS021,\n \n sum(case when ccsr_category = 'NVS022' then dx_code else 0 end) as dxccsr_NVS022,\n \n sum(case when ccsr_category = 'PNL001' then dx_code else 0 end) as dxccsr_PNL001,\n \n sum(case when ccsr_category = 'PNL002' then dx_code else 0 end) as dxccsr_PNL002,\n \n sum(case when ccsr_category = 'PNL003' then dx_code else 0 end) as dxccsr_PNL003,\n \n sum(case when ccsr_category = 'PNL004' then dx_code else 0 end) as dxccsr_PNL004,\n \n sum(case when ccsr_category = 'PNL005' then dx_code else 0 end) as dxccsr_PNL005,\n \n sum(case when ccsr_category = 'PNL006' then dx_code else 0 end) as dxccsr_PNL006,\n \n sum(case when ccsr_category = 'PNL007' then dx_code else 0 end) as dxccsr_PNL007,\n \n sum(case when ccsr_category = 'PNL008' then dx_code else 0 end) as dxccsr_PNL008,\n \n sum(case when ccsr_category = 'PNL009' then dx_code else 0 end) as dxccsr_PNL009,\n \n sum(case when ccsr_category = 'PNL010' then dx_code else 0 end) as dxccsr_PNL010,\n \n sum(case when ccsr_category = 'PNL011' then dx_code else 0 end) as dxccsr_PNL011,\n \n sum(case when ccsr_category = 'PNL012' then dx_code else 0 end) as dxccsr_PNL012,\n \n sum(case when ccsr_category = 'PNL013' then dx_code else 0 end) as dxccsr_PNL013,\n \n sum(case when ccsr_category = 'PNL014' then dx_code else 0 end) as dxccsr_PNL014,\n \n sum(case when ccsr_category = 'PNL015' then dx_code else 0 end) as dxccsr_PNL015,\n \n sum(case when ccsr_category = 'PRG001' then dx_code else 0 end) as dxccsr_PRG001,\n \n sum(case when ccsr_category = 'PRG002' then dx_code else 0 end) as dxccsr_PRG002,\n \n sum(case when ccsr_category = 'PRG003' then dx_code else 0 end) as dxccsr_PRG003,\n \n sum(case when ccsr_category = 'PRG004' then dx_code else 0 end) as dxccsr_PRG004,\n \n sum(case when ccsr_category = 'PRG005' then dx_code else 0 end) as dxccsr_PRG005,\n \n sum(case when ccsr_category = 'PRG006' then dx_code else 0 end) as dxccsr_PRG006,\n \n sum(case when ccsr_category = 'PRG007' then dx_code else 0 end) as dxccsr_PRG007,\n \n sum(case when ccsr_category = 'PRG008' then dx_code else 0 end) as dxccsr_PRG008,\n \n sum(case when ccsr_category = 'PRG009' then dx_code else 0 end) as dxccsr_PRG009,\n \n sum(case when ccsr_category = 'PRG010' then dx_code else 0 end) as dxccsr_PRG010,\n \n sum(case when ccsr_category = 'PRG011' then dx_code else 0 end) as dxccsr_PRG011,\n \n sum(case when ccsr_category = 'PRG012' then dx_code else 0 end) as dxccsr_PRG012,\n \n sum(case when ccsr_category = 'PRG013' then dx_code else 0 end) as dxccsr_PRG013,\n \n sum(case when ccsr_category = 'PRG014' then dx_code else 0 end) as dxccsr_PRG014,\n \n sum(case when ccsr_category = 'PRG015' then dx_code else 0 end) as dxccsr_PRG015,\n \n sum(case when ccsr_category = 'PRG016' then dx_code else 0 end) as dxccsr_PRG016,\n \n sum(case when ccsr_category = 'PRG017' then dx_code else 0 end) as dxccsr_PRG017,\n \n sum(case when ccsr_category = 'PRG018' then dx_code else 0 end) as dxccsr_PRG018,\n \n sum(case when ccsr_category = 'PRG019' then dx_code else 0 end) as dxccsr_PRG019,\n \n sum(case when ccsr_category = 'PRG020' then dx_code else 0 end) as dxccsr_PRG020,\n \n sum(case when ccsr_category = 'PRG021' then dx_code else 0 end) as dxccsr_PRG021,\n \n sum(case when ccsr_category = 'PRG022' then dx_code else 0 end) as dxccsr_PRG022,\n \n sum(case when ccsr_category = 'PRG023' then dx_code else 0 end) as dxccsr_PRG023,\n \n sum(case when ccsr_category = 'PRG024' then dx_code else 0 end) as dxccsr_PRG024,\n \n sum(case when ccsr_category = 'PRG025' then dx_code else 0 end) as dxccsr_PRG025,\n \n sum(case when ccsr_category = 'PRG026' then dx_code else 0 end) as dxccsr_PRG026,\n \n sum(case when ccsr_category = 'PRG027' then dx_code else 0 end) as dxccsr_PRG027,\n \n sum(case when ccsr_category = 'PRG028' then dx_code else 0 end) as dxccsr_PRG028,\n \n sum(case when ccsr_category = 'PRG029' then dx_code else 0 end) as dxccsr_PRG029,\n \n sum(case when ccsr_category = 'PRG030' then dx_code else 0 end) as dxccsr_PRG030,\n \n sum(case when ccsr_category = 'RSP001' then dx_code else 0 end) as dxccsr_RSP001,\n \n sum(case when ccsr_category = 'RSP002' then dx_code else 0 end) as dxccsr_RSP002,\n \n sum(case when ccsr_category = 'RSP003' then dx_code else 0 end) as dxccsr_RSP003,\n \n sum(case when ccsr_category = 'RSP004' then dx_code else 0 end) as dxccsr_RSP004,\n \n sum(case when ccsr_category = 'RSP005' then dx_code else 0 end) as dxccsr_RSP005,\n \n sum(case when ccsr_category = 'RSP006' then dx_code else 0 end) as dxccsr_RSP006,\n \n sum(case when ccsr_category = 'RSP007' then dx_code else 0 end) as dxccsr_RSP007,\n \n sum(case when ccsr_category = 'RSP008' then dx_code else 0 end) as dxccsr_RSP008,\n \n sum(case when ccsr_category = 'RSP009' then dx_code else 0 end) as dxccsr_RSP009,\n \n sum(case when ccsr_category = 'RSP010' then dx_code else 0 end) as dxccsr_RSP010,\n \n sum(case when ccsr_category = 'RSP011' then dx_code else 0 end) as dxccsr_RSP011,\n \n sum(case when ccsr_category = 'RSP012' then dx_code else 0 end) as dxccsr_RSP012,\n \n sum(case when ccsr_category = 'RSP013' then dx_code else 0 end) as dxccsr_RSP013,\n \n sum(case when ccsr_category = 'RSP014' then dx_code else 0 end) as dxccsr_RSP014,\n \n sum(case when ccsr_category = 'RSP015' then dx_code else 0 end) as dxccsr_RSP015,\n \n sum(case when ccsr_category = 'RSP016' then dx_code else 0 end) as dxccsr_RSP016,\n \n sum(case when ccsr_category = 'RSP017' then dx_code else 0 end) as dxccsr_RSP017,\n \n sum(case when ccsr_category = 'SKN001' then dx_code else 0 end) as dxccsr_SKN001,\n \n sum(case when ccsr_category = 'SKN002' then dx_code else 0 end) as dxccsr_SKN002,\n \n sum(case when ccsr_category = 'SKN003' then dx_code else 0 end) as dxccsr_SKN003,\n \n sum(case when ccsr_category = 'SKN004' then dx_code else 0 end) as dxccsr_SKN004,\n \n sum(case when ccsr_category = 'SKN005' then dx_code else 0 end) as dxccsr_SKN005,\n \n sum(case when ccsr_category = 'SKN006' then dx_code else 0 end) as dxccsr_SKN006,\n \n sum(case when ccsr_category = 'SKN007' then dx_code else 0 end) as dxccsr_SKN007,\n \n sum(case when ccsr_category = 'SYM001' then dx_code else 0 end) as dxccsr_SYM001,\n \n sum(case when ccsr_category = 'SYM002' then dx_code else 0 end) as dxccsr_SYM002,\n \n sum(case when ccsr_category = 'SYM003' then dx_code else 0 end) as dxccsr_SYM003,\n \n sum(case when ccsr_category = 'SYM004' then dx_code else 0 end) as dxccsr_SYM004,\n \n sum(case when ccsr_category = 'SYM005' then dx_code else 0 end) as dxccsr_SYM005,\n \n sum(case when ccsr_category = 'SYM006' then dx_code else 0 end) as dxccsr_SYM006,\n \n sum(case when ccsr_category = 'SYM007' then dx_code else 0 end) as dxccsr_SYM007,\n \n sum(case when ccsr_category = 'SYM008' then dx_code else 0 end) as dxccsr_SYM008,\n \n sum(case when ccsr_category = 'SYM009' then dx_code else 0 end) as dxccsr_SYM009,\n \n sum(case when ccsr_category = 'SYM010' then dx_code else 0 end) as dxccsr_SYM010,\n \n sum(case when ccsr_category = 'SYM011' then dx_code else 0 end) as dxccsr_SYM011,\n \n sum(case when ccsr_category = 'SYM012' then dx_code else 0 end) as dxccsr_SYM012,\n \n sum(case when ccsr_category = 'SYM013' then dx_code else 0 end) as dxccsr_SYM013,\n \n sum(case when ccsr_category = 'SYM014' then dx_code else 0 end) as dxccsr_SYM014,\n \n sum(case when ccsr_category = 'SYM015' then dx_code else 0 end) as dxccsr_SYM015,\n \n sum(case when ccsr_category = 'SYM016' then dx_code else 0 end) as dxccsr_SYM016,\n \n sum(case when ccsr_category = 'SYM017' then dx_code else 0 end) as dxccsr_SYM017,\n \n '2023.1' as dxccsr_version,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom bool_logic\ngroup by encounter_id, claim_id, patient_id, dxccsr_version, tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__wide_procedure_category": {"database": "tuva", "schema": "ccsr", "name": "ccsr__wide_procedure_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__wide_procedure_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__wide_procedure_category.sql", "unique_id": "model.the_tuva_project.ccsr__wide_procedure_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__wide_procedure_category"], "alias": "wide_procedure_category", "checksum": {"name": "sha256", "checksum": "a5a96f417644e7a2fcb1edfb4b2c4a454ecb7824dcd012e5b3e495f4d32b7271"}, "config": {"enabled": true, "alias": "wide_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a row for each input record with a column for every CCSR procedure category. \nEach column contains a value of 0 or 1. These values indicate:\n * 0 \\- The CCSR was not triggered by any ICD-10-PCS code on the input record.\n * 1 \\- The CCSR was triggered by a procedure on the input record. \n\nWhile the CCSR maps to values 0-3, these values require a procedure rank, but no rank is\nincluded in the TUVA procedure model.\n\nThis table doesn't include any category descriptions, but category and parent category descriptions\ncan be found by querying the target column name against the `ccsr_procedure_category_map` intermediate model. \n", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\final\\ccsr__wide_procedure_category.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "wide_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.1624901, "relation_name": "tuva.ccsr.wide_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set categories_list = dbt_utils.get_column_values(\r\n table=ref(\"ccsr__procedure_category_map\"),\r\n column=\"ccsr_category\",\r\n order_by=\"ccsr_category\"\r\n) %}\r\n\r\nwith dedupe_records as (\r\n\r\n select distinct\r\n encounter_id,\r\n patient_id,\r\n ccsr_category\r\n from {{ ref('ccsr__long_procedure_category') }} \r\n\r\n)\r\n\r\nselect\r\n encounter_id,\r\n patient_id,\r\n -- pivot rows into column values for each possible CCSR category\r\n {% for category in categories_list %}\r\n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\r\n sum(case when ccsr_category = '{{ category }}' then 1 else 0 end) as prccsr_{{ category|lower }},\r\n {% endfor %}\r\n {{ var('prccsr_version') }} as prccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom dedupe_records\r\ngroup by encounter_id, patient_id, prccsr_version, tuva_last_run", "language": "sql", "refs": [["ccsr__procedure_category_map"], ["ccsr__long_procedure_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values"], "nodes": ["model.the_tuva_project.ccsr__procedure_category_map", "model.the_tuva_project.ccsr__long_procedure_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__wide_procedure_category.sql", "compiled": true, "compiled_code": "\n\n\n\nwith dedupe_records as (\n\n select distinct\n encounter_id,\n patient_id,\n ccsr_category\n from tuva.ccsr.long_procedure_category \n\n)\n\nselect\n encounter_id,\n patient_id,\n -- pivot rows into column values for each possible CCSR category\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM001' then 1 else 0 end) as prccsr_adm001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM002' then 1 else 0 end) as prccsr_adm002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM003' then 1 else 0 end) as prccsr_adm003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM004' then 1 else 0 end) as prccsr_adm004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM005' then 1 else 0 end) as prccsr_adm005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM006' then 1 else 0 end) as prccsr_adm006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM007' then 1 else 0 end) as prccsr_adm007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM008' then 1 else 0 end) as prccsr_adm008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM009' then 1 else 0 end) as prccsr_adm009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM010' then 1 else 0 end) as prccsr_adm010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM011' then 1 else 0 end) as prccsr_adm011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM012' then 1 else 0 end) as prccsr_adm012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM013' then 1 else 0 end) as prccsr_adm013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM014' then 1 else 0 end) as prccsr_adm014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM015' then 1 else 0 end) as prccsr_adm015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM016' then 1 else 0 end) as prccsr_adm016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM017' then 1 else 0 end) as prccsr_adm017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM018' then 1 else 0 end) as prccsr_adm018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM019' then 1 else 0 end) as prccsr_adm019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM020' then 1 else 0 end) as prccsr_adm020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM021' then 1 else 0 end) as prccsr_adm021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM022' then 1 else 0 end) as prccsr_adm022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR001' then 1 else 0 end) as prccsr_car001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR002' then 1 else 0 end) as prccsr_car002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR003' then 1 else 0 end) as prccsr_car003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR004' then 1 else 0 end) as prccsr_car004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR005' then 1 else 0 end) as prccsr_car005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR006' then 1 else 0 end) as prccsr_car006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR007' then 1 else 0 end) as prccsr_car007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR008' then 1 else 0 end) as prccsr_car008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR009' then 1 else 0 end) as prccsr_car009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR010' then 1 else 0 end) as prccsr_car010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR011' then 1 else 0 end) as prccsr_car011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR012' then 1 else 0 end) as prccsr_car012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR013' then 1 else 0 end) as prccsr_car013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR014' then 1 else 0 end) as prccsr_car014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR015' then 1 else 0 end) as prccsr_car015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR016' then 1 else 0 end) as prccsr_car016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR017' then 1 else 0 end) as prccsr_car017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR018' then 1 else 0 end) as prccsr_car018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR019' then 1 else 0 end) as prccsr_car019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR020' then 1 else 0 end) as prccsr_car020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR021' then 1 else 0 end) as prccsr_car021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR022' then 1 else 0 end) as prccsr_car022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR023' then 1 else 0 end) as prccsr_car023,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR024' then 1 else 0 end) as prccsr_car024,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR025' then 1 else 0 end) as prccsr_car025,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR026' then 1 else 0 end) as prccsr_car026,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR027' then 1 else 0 end) as prccsr_car027,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR028' then 1 else 0 end) as prccsr_car028,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR029' then 1 else 0 end) as prccsr_car029,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CHP001' then 1 else 0 end) as prccsr_chp001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS001' then 1 else 0 end) as prccsr_cns001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS002' then 1 else 0 end) as prccsr_cns002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS003' then 1 else 0 end) as prccsr_cns003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS004' then 1 else 0 end) as prccsr_cns004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS005' then 1 else 0 end) as prccsr_cns005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS006' then 1 else 0 end) as prccsr_cns006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS007' then 1 else 0 end) as prccsr_cns007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS008' then 1 else 0 end) as prccsr_cns008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS009' then 1 else 0 end) as prccsr_cns009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS010' then 1 else 0 end) as prccsr_cns010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS011' then 1 else 0 end) as prccsr_cns011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS012' then 1 else 0 end) as prccsr_cns012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS013' then 1 else 0 end) as prccsr_cns013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS014' then 1 else 0 end) as prccsr_cns014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP001' then 1 else 0 end) as prccsr_enp001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP002' then 1 else 0 end) as prccsr_enp002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP003' then 1 else 0 end) as prccsr_enp003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP004' then 1 else 0 end) as prccsr_enp004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP005' then 1 else 0 end) as prccsr_enp005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP006' then 1 else 0 end) as prccsr_enp006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT001' then 1 else 0 end) as prccsr_ent001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT002' then 1 else 0 end) as prccsr_ent002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT003' then 1 else 0 end) as prccsr_ent003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT004' then 1 else 0 end) as prccsr_ent004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT005' then 1 else 0 end) as prccsr_ent005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT006' then 1 else 0 end) as prccsr_ent006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT007' then 1 else 0 end) as prccsr_ent007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT008' then 1 else 0 end) as prccsr_ent008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT009' then 1 else 0 end) as prccsr_ent009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT010' then 1 else 0 end) as prccsr_ent010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT011' then 1 else 0 end) as prccsr_ent011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT012' then 1 else 0 end) as prccsr_ent012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT013' then 1 else 0 end) as prccsr_ent013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT014' then 1 else 0 end) as prccsr_ent014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT015' then 1 else 0 end) as prccsr_ent015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT016' then 1 else 0 end) as prccsr_ent016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT017' then 1 else 0 end) as prccsr_ent017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA001' then 1 else 0 end) as prccsr_esa001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA002' then 1 else 0 end) as prccsr_esa002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA003' then 1 else 0 end) as prccsr_esa003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA004' then 1 else 0 end) as prccsr_esa004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA005' then 1 else 0 end) as prccsr_esa005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA006' then 1 else 0 end) as prccsr_esa006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA007' then 1 else 0 end) as prccsr_esa007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA008' then 1 else 0 end) as prccsr_esa008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA009' then 1 else 0 end) as prccsr_esa009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA010' then 1 else 0 end) as prccsr_esa010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA011' then 1 else 0 end) as prccsr_esa011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST001' then 1 else 0 end) as prccsr_est001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST002' then 1 else 0 end) as prccsr_est002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST003' then 1 else 0 end) as prccsr_est003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST004' then 1 else 0 end) as prccsr_est004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST005' then 1 else 0 end) as prccsr_est005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EYP001' then 1 else 0 end) as prccsr_eyp001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EYP002' then 1 else 0 end) as prccsr_eyp002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS001' then 1 else 0 end) as prccsr_frs001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS002' then 1 else 0 end) as prccsr_frs002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS003' then 1 else 0 end) as prccsr_frs003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS004' then 1 else 0 end) as prccsr_frs004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS005' then 1 else 0 end) as prccsr_frs005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS006' then 1 else 0 end) as prccsr_frs006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS007' then 1 else 0 end) as prccsr_frs007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS008' then 1 else 0 end) as prccsr_frs008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS009' then 1 else 0 end) as prccsr_frs009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS010' then 1 else 0 end) as prccsr_frs010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS011' then 1 else 0 end) as prccsr_frs011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS012' then 1 else 0 end) as prccsr_frs012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS013' then 1 else 0 end) as prccsr_frs013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS014' then 1 else 0 end) as prccsr_frs014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS015' then 1 else 0 end) as prccsr_frs015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS001' then 1 else 0 end) as prccsr_gis001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS002' then 1 else 0 end) as prccsr_gis002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS003' then 1 else 0 end) as prccsr_gis003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS004' then 1 else 0 end) as prccsr_gis004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS005' then 1 else 0 end) as prccsr_gis005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS006' then 1 else 0 end) as prccsr_gis006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS007' then 1 else 0 end) as prccsr_gis007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS008' then 1 else 0 end) as prccsr_gis008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS009' then 1 else 0 end) as prccsr_gis009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS010' then 1 else 0 end) as prccsr_gis010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS011' then 1 else 0 end) as prccsr_gis011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS012' then 1 else 0 end) as prccsr_gis012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS013' then 1 else 0 end) as prccsr_gis013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS014' then 1 else 0 end) as prccsr_gis014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS015' then 1 else 0 end) as prccsr_gis015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS016' then 1 else 0 end) as prccsr_gis016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS017' then 1 else 0 end) as prccsr_gis017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS018' then 1 else 0 end) as prccsr_gis018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS019' then 1 else 0 end) as prccsr_gis019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS020' then 1 else 0 end) as prccsr_gis020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS021' then 1 else 0 end) as prccsr_gis021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS022' then 1 else 0 end) as prccsr_gis022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS023' then 1 else 0 end) as prccsr_gis023,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS024' then 1 else 0 end) as prccsr_gis024,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS025' then 1 else 0 end) as prccsr_gis025,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS026' then 1 else 0 end) as prccsr_gis026,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS027' then 1 else 0 end) as prccsr_gis027,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS028' then 1 else 0 end) as prccsr_gis028,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS029' then 1 else 0 end) as prccsr_gis029,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR001' then 1 else 0 end) as prccsr_gnr001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR002' then 1 else 0 end) as prccsr_gnr002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR003' then 1 else 0 end) as prccsr_gnr003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR004' then 1 else 0 end) as prccsr_gnr004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR005' then 1 else 0 end) as prccsr_gnr005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR006' then 1 else 0 end) as prccsr_gnr006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR007' then 1 else 0 end) as prccsr_gnr007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR008' then 1 else 0 end) as prccsr_gnr008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR009' then 1 else 0 end) as prccsr_gnr009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR010' then 1 else 0 end) as prccsr_gnr010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP001' then 1 else 0 end) as prccsr_hep001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP002' then 1 else 0 end) as prccsr_hep002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP003' then 1 else 0 end) as prccsr_hep003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP004' then 1 else 0 end) as prccsr_hep004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP005' then 1 else 0 end) as prccsr_hep005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP006' then 1 else 0 end) as prccsr_hep006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP007' then 1 else 0 end) as prccsr_hep007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP008' then 1 else 0 end) as prccsr_hep008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP009' then 1 else 0 end) as prccsr_hep009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP010' then 1 else 0 end) as prccsr_hep010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP011' then 1 else 0 end) as prccsr_hep011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP012' then 1 else 0 end) as prccsr_hep012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP013' then 1 else 0 end) as prccsr_hep013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG001' then 1 else 0 end) as prccsr_img001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG002' then 1 else 0 end) as prccsr_img002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG003' then 1 else 0 end) as prccsr_img003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG004' then 1 else 0 end) as prccsr_img004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG005' then 1 else 0 end) as prccsr_img005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG006' then 1 else 0 end) as prccsr_img006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG007' then 1 else 0 end) as prccsr_img007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG008' then 1 else 0 end) as prccsr_img008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG009' then 1 else 0 end) as prccsr_img009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG010' then 1 else 0 end) as prccsr_img010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM001' then 1 else 0 end) as prccsr_lym001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM002' then 1 else 0 end) as prccsr_lym002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM003' then 1 else 0 end) as prccsr_lym003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM004' then 1 else 0 end) as prccsr_lym004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM005' then 1 else 0 end) as prccsr_lym005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM006' then 1 else 0 end) as prccsr_lym006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM007' then 1 else 0 end) as prccsr_lym007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM008' then 1 else 0 end) as prccsr_lym008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM009' then 1 else 0 end) as prccsr_lym009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM010' then 1 else 0 end) as prccsr_lym010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM011' then 1 else 0 end) as prccsr_lym011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM001' then 1 else 0 end) as prccsr_mam001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM002' then 1 else 0 end) as prccsr_mam002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM003' then 1 else 0 end) as prccsr_mam003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM004' then 1 else 0 end) as prccsr_mam004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM005' then 1 else 0 end) as prccsr_mam005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM006' then 1 else 0 end) as prccsr_mam006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM007' then 1 else 0 end) as prccsr_mam007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM008' then 1 else 0 end) as prccsr_mam008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM009' then 1 else 0 end) as prccsr_mam009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM010' then 1 else 0 end) as prccsr_mam010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM011' then 1 else 0 end) as prccsr_mam011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM012' then 1 else 0 end) as prccsr_mam012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM013' then 1 else 0 end) as prccsr_mam013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM014' then 1 else 0 end) as prccsr_mam014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM015' then 1 else 0 end) as prccsr_mam015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT001' then 1 else 0 end) as prccsr_mht001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT002' then 1 else 0 end) as prccsr_mht002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT003' then 1 else 0 end) as prccsr_mht003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT004' then 1 else 0 end) as prccsr_mht004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT005' then 1 else 0 end) as prccsr_mht005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS001' then 1 else 0 end) as prccsr_mrs001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS002' then 1 else 0 end) as prccsr_mrs002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS003' then 1 else 0 end) as prccsr_mrs003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS004' then 1 else 0 end) as prccsr_mrs004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS005' then 1 else 0 end) as prccsr_mrs005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS006' then 1 else 0 end) as prccsr_mrs006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS007' then 1 else 0 end) as prccsr_mrs007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST001' then 1 else 0 end) as prccsr_mst001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST002' then 1 else 0 end) as prccsr_mst002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST003' then 1 else 0 end) as prccsr_mst003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST004' then 1 else 0 end) as prccsr_mst004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST005' then 1 else 0 end) as prccsr_mst005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST006' then 1 else 0 end) as prccsr_mst006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST007' then 1 else 0 end) as prccsr_mst007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST008' then 1 else 0 end) as prccsr_mst008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST009' then 1 else 0 end) as prccsr_mst009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST010' then 1 else 0 end) as prccsr_mst010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST011' then 1 else 0 end) as prccsr_mst011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST012' then 1 else 0 end) as prccsr_mst012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST013' then 1 else 0 end) as prccsr_mst013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST014' then 1 else 0 end) as prccsr_mst014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST015' then 1 else 0 end) as prccsr_mst015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST016' then 1 else 0 end) as prccsr_mst016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST017' then 1 else 0 end) as prccsr_mst017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST018' then 1 else 0 end) as prccsr_mst018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST019' then 1 else 0 end) as prccsr_mst019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST020' then 1 else 0 end) as prccsr_mst020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST021' then 1 else 0 end) as prccsr_mst021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST022' then 1 else 0 end) as prccsr_mst022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST023' then 1 else 0 end) as prccsr_mst023,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST024' then 1 else 0 end) as prccsr_mst024,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST025' then 1 else 0 end) as prccsr_mst025,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST026' then 1 else 0 end) as prccsr_mst026,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST027' then 1 else 0 end) as prccsr_mst027,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST028' then 1 else 0 end) as prccsr_mst028,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST029' then 1 else 0 end) as prccsr_mst029,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST030' then 1 else 0 end) as prccsr_mst030,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM001' then 1 else 0 end) as prccsr_ncm001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM002' then 1 else 0 end) as prccsr_ncm002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM003' then 1 else 0 end) as prccsr_ncm003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM004' then 1 else 0 end) as prccsr_ncm004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OST001' then 1 else 0 end) as prccsr_ost001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR001' then 1 else 0 end) as prccsr_otr001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR002' then 1 else 0 end) as prccsr_otr002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR003' then 1 else 0 end) as prccsr_otr003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR004' then 1 else 0 end) as prccsr_otr004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR005' then 1 else 0 end) as prccsr_otr005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN001' then 1 else 0 end) as prccsr_pgn001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN002' then 1 else 0 end) as prccsr_pgn002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN003' then 1 else 0 end) as prccsr_pgn003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN004' then 1 else 0 end) as prccsr_pgn004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN005' then 1 else 0 end) as prccsr_pgn005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN006' then 1 else 0 end) as prccsr_pgn006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN007' then 1 else 0 end) as prccsr_pgn007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN008' then 1 else 0 end) as prccsr_pgn008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN009' then 1 else 0 end) as prccsr_pgn009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PLC001' then 1 else 0 end) as prccsr_plc001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PLC002' then 1 else 0 end) as prccsr_plc002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS001' then 1 else 0 end) as prccsr_pns001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS002' then 1 else 0 end) as prccsr_pns002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS003' then 1 else 0 end) as prccsr_pns003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS004' then 1 else 0 end) as prccsr_pns004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS005' then 1 else 0 end) as prccsr_pns005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS006' then 1 else 0 end) as prccsr_pns006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD001' then 1 else 0 end) as prccsr_rad001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD002' then 1 else 0 end) as prccsr_rad002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD003' then 1 else 0 end) as prccsr_rad003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD004' then 1 else 0 end) as prccsr_rad004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES001' then 1 else 0 end) as prccsr_res001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES002' then 1 else 0 end) as prccsr_res002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES003' then 1 else 0 end) as prccsr_res003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES004' then 1 else 0 end) as prccsr_res004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES005' then 1 else 0 end) as prccsr_res005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES006' then 1 else 0 end) as prccsr_res006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES007' then 1 else 0 end) as prccsr_res007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES008' then 1 else 0 end) as prccsr_res008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES009' then 1 else 0 end) as prccsr_res009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES010' then 1 else 0 end) as prccsr_res010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES011' then 1 else 0 end) as prccsr_res011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES012' then 1 else 0 end) as prccsr_res012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES013' then 1 else 0 end) as prccsr_res013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES014' then 1 else 0 end) as prccsr_res014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB001' then 1 else 0 end) as prccsr_rhb001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB002' then 1 else 0 end) as prccsr_rhb002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB003' then 1 else 0 end) as prccsr_rhb003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB004' then 1 else 0 end) as prccsr_rhb004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB001' then 1 else 0 end) as prccsr_skb001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB002' then 1 else 0 end) as prccsr_skb002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB003' then 1 else 0 end) as prccsr_skb003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB004' then 1 else 0 end) as prccsr_skb004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB005' then 1 else 0 end) as prccsr_skb005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB006' then 1 else 0 end) as prccsr_skb006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB007' then 1 else 0 end) as prccsr_skb007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB008' then 1 else 0 end) as prccsr_skb008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB009' then 1 else 0 end) as prccsr_skb009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB010' then 1 else 0 end) as prccsr_skb010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD001' then 1 else 0 end) as prccsr_sud001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD002' then 1 else 0 end) as prccsr_sud002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD003' then 1 else 0 end) as prccsr_sud003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD004' then 1 else 0 end) as prccsr_sud004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN001' then 1 else 0 end) as prccsr_urn001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN002' then 1 else 0 end) as prccsr_urn002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN003' then 1 else 0 end) as prccsr_urn003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN004' then 1 else 0 end) as prccsr_urn004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN005' then 1 else 0 end) as prccsr_urn005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN006' then 1 else 0 end) as prccsr_urn006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN007' then 1 else 0 end) as prccsr_urn007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN008' then 1 else 0 end) as prccsr_urn008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN009' then 1 else 0 end) as prccsr_urn009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN010' then 1 else 0 end) as prccsr_urn010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN011' then 1 else 0 end) as prccsr_urn011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN012' then 1 else 0 end) as prccsr_urn012,\n \n '2023.1' as prccsr_version,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom dedupe_records\ngroup by encounter_id, patient_id, prccsr_version, tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"database": "tuva", "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": "6b64bb5700551524c1025679e96a99945c531aac89d6377531a44700e854812a"}, "config": {"enabled": true, "alias": "dx_vertical_pivot", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "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, "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, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "dx_vertical_pivot", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.138832, "relation_name": "tuva.ccsr.dx_vertical_pivot", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__dxccsr_v2023_1_cleaned_map"]], "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 tuva.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 '2023-09-05 20:45:28.914033+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": []}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "tuva", "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": "d759906e0f8f156c9796b7b571bafb6795e66c80f993f8758edaab57226eeb2a"}, "config": {"enabled": true, "alias": "procedure_category_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "procedure_category_map", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.138832, "relation_name": "tuva.ccsr.procedure_category_map", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__prccsr_v2023_1_cleaned_map"]], "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 '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "58bfbd6d39695f1589b0cdb3e898932d48e10765563ac69c3489e1094b0e1a15"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1693946732.1674922, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "tuva", "schema": "claims_data_model", "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": "44d8ae3e59950ce973f04cc24eb71d41efb4fcd04e1ab181ffade1ef71e5b626"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1693946732.169503, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "tuva", "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": "b4641588f45258fe5df14e4e2e5d139d33a97d5da7a0c0a960fa43571e798a8c"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.2095368, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_all"], ["chronic_conditions__cms_chronic_conditions_hiv_aids"], ["chronic_conditions__cms_chronic_conditions_oud"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\n union distinct\n select * from tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\n union distinct\n select * from tuva.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "tuva", "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": "9ea114b7ec20cfd07cca20bc83b57cc325759c758f8fe4014ed1fbf68c374d84"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "adhd_conduct_disorders_and_hyperkinetic_syndrome": {"name": "adhd_conduct_disorders_and_hyperkinetic_syndrome", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_urologic_kidney_renal_pelvis_and_ureter": {"name": "cancer_urologic_kidney_renal_pelvis_and_ureter", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis_and_other_metabolic_developmental_disorders": {"name": "cystic_fibrosis_and_other_metabolic_developmental_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression_bipolar_or_other_depressive_mood_disorders": {"name": "depression_bipolar_or_other_depressive_mood_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "fibromyalgia_and_chronic_pain_and_fatigue": {"name": "fibromyalgia_and_chronic_pain_and_fatigue", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure_and_non_ischemic_heart_disease": {"name": "heart_failure_and_non_ischemic_heart_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_acute_or_unspecified": {"name": "hepatitis_b_acute_or_unspecified", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "intellectual_disabilities_and_related_conditions": {"name": "intellectual_disabilities_and_related_conditions", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis_and_transverse_myelitis": {"name": "multiple_sclerosis_and_transverse_myelitis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "osteoporosis_with_or_without_pathological_fracture": {"name": "osteoporosis_with_or_without_pathological_fracture", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease_and_secondary_parkinsonism": {"name": "parkinsons_disease_and_secondary_parkinsonism", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder_ptsd": {"name": "post_traumatic_stress_disorder_ptsd", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia_and_other_psychotic_disorders": {"name": "schizophrenia_and_other_psychotic_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_blindness_and_visual_impairment": {"name": "sensory_blindness_and_visual_impairment", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_deafness_and_hearing_impairment": {"name": "sensory_deafness_and_hearing_impairment", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.2095368, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["chronic_conditions__cms_chronic_conditions_long"], ["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__patient"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n),chronic_conditions as (\n\n select distinct\n condition\n , condition_column_name\n from tuva.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 tuva.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 , '2023-09-05 20:45:28.914033+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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "tuva", "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": "32f68515d0321c809f2b8aa8d05a563409368b385ef47fcea40c3a7ac6872061"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.2722974, "relation_name": "tuva.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))))\r\n )\r\n}}\r\n\r\nwith condition_row_number as (\r\n\r\n select \r\n patient_id\r\n , normalized_code\r\n , recorded_date\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , normalized_code\r\n order by recorded_date asc\r\n ) as rn_asc\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , normalized_code\r\n order by recorded_date desc\r\n ) as rn_desc\r\n from {{ ref('tuva_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select \r\n patient_id\r\n , normalized_code as icd_10_cm\r\n , max(\r\n case\r\n when rn_asc = 1\r\n then recorded_date\r\n end\r\n ) as first_diagnosis_date\r\n , max(\r\n case\r\n when rn_desc = 1\r\n then recorded_date\r\n end\r\n ) as last_diagnosis_date\r\n from condition_row_number\r\n group by \r\n patient_id\r\n , normalized_code\r\n\r\n)\r\n\r\nselect \r\n pc.patient_id\r\n , h.condition_family\r\n , h.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 {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }} h\r\n inner join patient_conditions pc\r\n on h.icd_10_cm_code = pc.icd_10_cm\r\ngroup by \r\n pc.patient_id\r\n , h.condition_family\r\n , h.condition", "language": "sql", "refs": [["tuva_chronic_conditions__stg_core__condition"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"]}, "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n),condition_row_number as (\n\n select \n patient_id\n , normalized_code\n , recorded_date\n , row_number() over(\n partition by\n patient_id\n , normalized_code\n order by recorded_date asc\n ) as rn_asc\n , row_number() over(\n partition by\n patient_id\n , normalized_code\n order by recorded_date desc\n ) as rn_desc\n from __dbt__cte__tuva_chronic_conditions__stg_core__condition\n\n)\n\n, patient_conditions as (\n\n select \n patient_id\n , normalized_code as icd_10_cm\n , max(\n case\n when rn_asc = 1\n then recorded_date\n end\n ) as first_diagnosis_date\n , max(\n case\n when rn_desc = 1\n then recorded_date\n end\n ) as last_diagnosis_date\n from condition_row_number\n group by \n patient_id\n , normalized_code\n\n)\n\nselect \n pc.patient_id\n , h.condition_family\n , h.condition\n , min(first_diagnosis_date) as first_diagnosis_date\n , max(last_diagnosis_date) as last_diagnosis_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy h\n inner join patient_conditions pc\n on h.icd_10_cm_code = pc.icd_10_cm\ngroup by \n pc.patient_id\n , h.condition_family\n , h.condition", "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}]}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "tuva", "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": "dbafd459550d5c36fc38a417f517e896e772b6ab45d04ab8ffd6a293db958670"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.296062, "relation_name": "tuva.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))))\r\n )\r\n}}\r\n\r\nwith condition_columns as (\r\n\r\n select distinct\r\n condition\r\n , condition_column_name\r\n from {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\nselect\r\n p.patient_id\r\n , {{ dbt_utils.pivot(\r\n column='cc.condition_column_name'\r\n , values=dbt_utils.get_column_values(\r\n ref('chronic_conditions__tuva_chronic_conditions_hierarchy')\r\n , 'condition_column_name'\r\n ,'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('tuva_chronic_conditions__stg_core__patient') }} p\r\n left join {{ ref('chronic_conditions__tuva_chronic_conditions_long') }} l\r\n on p.patient_id = l.patient_id\r\n left join condition_columns cc\r\n on l.condition = cc.condition\r\ngroup by\r\n p.patient_id", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["tuva_chronic_conditions__stg_core__patient"], ["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "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 __dbt__cte__tuva_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n),condition_columns as (\n\n select distinct\n condition\n , condition_column_name\n from tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy\n\n)\n\nselect\n p.patient_id\n , \n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'ALCOHOL'\n then 1\n else 0\n end\n )\n \n \n as alcohol\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'AMYOTROPHIC_LATERAL_SCLEROSIS'\n then 1\n else 0\n end\n )\n \n \n as amyotrophic_lateral_sclerosis\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ANXIETY'\n then 1\n else 0\n end\n )\n \n \n as anxiety\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'ATHEROSCLEROSIS'\n then 1\n else 0\n end\n )\n \n \n as atherosclerosis\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ATRIAL_FIBRILLATION'\n then 1\n else 0\n end\n )\n \n \n as atrial_fibrillation\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ATTENTION_DEFICIT_HYPERACTIVITY_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as attention_deficit_hyperactivity_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'BIPOLAR'\n then 1\n else 0\n end\n )\n \n \n as bipolar\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'BREAST_CANCER'\n then 1\n else 0\n end\n )\n \n \n as breast_cancer\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.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 cc.condition_column_name = 'COCAINE'\n then 1\n else 0\n end\n )\n \n \n as cocaine\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'COLORECTAL_CANCER'\n then 1\n else 0\n end\n )\n \n \n as colorectal_cancer\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'CROHNS_DISEASE'\n then 1\n else 0\n end\n )\n \n \n as crohns_disease\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'CYSTIC_FIBROSIS'\n then 1\n else 0\n end\n )\n \n \n as cystic_fibrosis\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'DEMENTIA'\n then 1\n else 0\n end\n )\n \n \n as dementia\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'DEPRESSION'\n then 1\n else 0\n end\n )\n \n \n as depression\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'HEART_FAILURE'\n then 1\n else 0\n end\n )\n \n \n as heart_failure\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.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 cc.condition_column_name = 'LUNG_CANCER'\n then 1\n else 0\n end\n )\n \n \n as lung_cancer\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'LUPUS'\n then 1\n else 0\n end\n )\n \n \n as lupus\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'METABOLIC_SYNDROME'\n then 1\n else 0\n end\n )\n \n \n as metabolic_syndrome\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'MULTIPLE_SCLEROSIS'\n then 1\n else 0\n end\n )\n \n \n as multiple_sclerosis\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.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 cc.condition_column_name = 'OBSESSIVE_COMPULSIVE_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as obsessive_compulsive_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'OPIOID'\n then 1\n else 0\n end\n )\n \n \n as opioid\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'PARKINSONS_DISEASE'\n then 1\n else 0\n end\n )\n \n \n as parkinsons_disease\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'PERSONALITY_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as personality_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'POST_TRAUMATIC_STRESS_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as post_traumatic_stress_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'RHEUMATOID_ARTHRITIS'\n then 1\n else 0\n end\n )\n \n \n as rheumatoid_arthritis\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'STROKE'\n then 1\n else 0\n end\n )\n \n \n as stroke\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'TOBACCO'\n then 1\n else 0\n end\n )\n \n \n as tobacco\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'TYPE_1_DIABETES'\n then 1\n else 0\n end\n )\n \n \n as type_1_diabetes\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'TYPE_2_DIABETES'\n then 1\n else 0\n end\n )\n \n \n as type_2_diabetes\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ULCERATIVE_COLITIS'\n then 1\n else 0\n end\n )\n \n \n as ulcerative_colitis\n \n \n \n \n\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__tuva_chronic_conditions__stg_core__patient p\n left join tuva.chronic_conditions.tuva_chronic_conditions_long l\n on p.patient_id = l.patient_id\n left join condition_columns cc\n on l.condition = cc.condition\ngroup by\n p.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "sql": " __dbt__cte__tuva_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"database": "tuva", "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": "4066b0b7caf3a140a892da8303ed785c9970171825cdfb038f8f2fc0db06368e"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_all", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.218571, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"], ["cms_chronic_conditions__stg_core__procedure"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),chronic_conditions as (\n\n select * from tuva.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 , '2023-09-05 20:45:28.914033+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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "tuva", "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": "650c4fd2c4e598a83cce3814a54ba40588aeb532c40567366cb6535b002a125f"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_hiv_aids", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.2220778, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),chronic_conditions as (\n\n select * from tuva.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 , '2023-09-05 20:45:28.914033+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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "tuva", "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": "0edbbe01903e631fdff00a390367aea7fcfff5ec1a5454994a1c357bb42f4df5"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_oud", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "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": "#2e0e0e"}}, "created_at": 1693946732.228588, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_pharmacy_claim"], ["cms_chronic_conditions__stg_core__procedure"], ["chronic_conditions__cms_chronic_conditions_all"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),chronic_conditions as (\n\n select * from tuva.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 tuva.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 , '2023-09-05 20:45:28.914033+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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "14bc859c362a0bf063c1f1b5573c4c3c579fe36fd016b68a559c9d342ad97a8a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.2296414, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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') }}", "language": "sql", "refs": [["core__condition"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "claims_data_model", "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": "c1179facf8d0fe84d23bb48595d8788b7ea24239af870f2765aeda6b3202b689"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.2296414, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["core__patient"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "tuva", "schema": "claims_data_model", "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": "a2edc7f43347634a329a5572d5f6d1070cb7b922b028572a264d75b6574765f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.234236, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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') }}", "language": "sql", "refs": [["core__procedure"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "837370350f0cfe6af7920826ec0af6ad83b3c1e27127cfdf58e08341fcaa0257"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.2390597, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "tuva", "schema": "claims_data_model", "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": "31b3681bfce9e02877c6b2a296a731d66d53751cec210a6ee7367f78271c1198"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.2390597, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "48dd1d737654e1702b462ae927368771052d05c66bd16365187e51f67470f5ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.29857, "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))))\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": [["core__condition"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "claims_data_model", "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": "1f922ebd0ff235d61d3cecfacf5b7fb056cf6b55b1dc14c054df6b07b38e4a0b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1693946732.300872, "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))))\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": [["core__patient"]], "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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__summary": {"database": "tuva", "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": "c8464ad078ee837af7f0b3ca7110acb6669e1c96ee12a48bdf3fae13893b63b5"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "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, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "acute_inpatient_summary", "tags": "acute_inpatient", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3098226, "relation_name": "tuva.claims_preprocessing.acute_inpatient_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('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\nselect\r\n b.encounter_id\r\n, max(a.facility_npi) as facility_npi\r\n, max(ms_drg_code) as ms_drg_code\r\n, max(apr_drg_code) as apr_drg_code\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, 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\nfrom {{ ref('medical_claim') }} a\r\ninner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_type = 'institutional'\r\ngroup by 1\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('acute_inpatient__stg_medical_claim') }} a\r\ninner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\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('acute_inpatient__stg_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('acute_inpatient__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, 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 + d.prof_paid_amount as total_paid_amount\r\n, c.inst_allowed_amount + d.prof_allowed_amount as total_allowed_amount\r\n, c.inst_charge_amount + d.prof_charge_amount 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", "language": "sql", "refs": [["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"], ["medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__stg_eligibility"], ["acute_inpatient__institutional_encounter_id"], ["terminology__provider"], ["terminology__discharge_disposition"], ["terminology__admit_source"], ["terminology__admit_type"], ["terminology__ms_drg"], ["terminology__apr_drg"]], "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.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "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"]}, "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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__acute_inpatient__stg_eligibility as (\n\n\nselect\n patient_id\n, birth_date\n, gender\n, race\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n),distinct_encounters as (\nselect distinct\n a.encounter_id\n, a.patient_id\n, b.encounter_start_date\n, b.encounter_end_date\nfrom tuva.claims_preprocessing._int_acute_inpatient_encounter_id a\ninner join tuva.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 (\nselect\n b.encounter_id\n, max(a.facility_npi) as facility_npi\n, max(ms_drg_code) as ms_drg_code\n, max(apr_drg_code) as apr_drg_code\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, 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\nfrom tuva.claims_data_model.medical_claim a\ninner join tuva.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_type = 'institutional'\ngroup by 1\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 __dbt__cte__acute_inpatient__stg_medical_claim a\ninner join tuva.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\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 __dbt__cte__acute_inpatient__stg_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 tuva.claims_preprocessing._int_acute_inpatient_institutional_encounter_id a\nleft join tuva.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, 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 + d.prof_paid_amount as total_paid_amount\n, c.inst_allowed_amount + d.prof_allowed_amount as total_allowed_amount\n, c.inst_charge_amount + d.prof_charge_amount 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, '2023-09-05 20:45:28.914033+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 tuva.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join tuva.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join tuva.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join tuva.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join tuva.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code", "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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}]}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "tuva", "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": "ab00894727d4eecd7ecf78a6182ddfc159c3138154a556548aac139e1414203f"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_claims_with_encounter_data", "tags": "acute_inpatient", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.348477, "relation_name": "tuva.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)))\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": [["acute_inpatient__institutional_claims"], ["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"]], "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 tuva.claims_preprocessing._int_acute_inpatient_institutional_claims aa\n\nleft join\ntuva.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\ntuva.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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "tuva", "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": "2769efc3ae1d7465fafb2afef5c686d9f2e66cb61006a02ea0350c6a0eeb7653"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_data_quality_summary", "tags": "acute_inpatient", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3224063, "relation_name": "tuva.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)))\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": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"]], "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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "tuva", "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": "a25796e8c81144e4f18d2391087fed8d9e9a18a98c8627e917a4ac528662c509"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_encounter_data_for_medical_claims", "tags": "acute_inpatient", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3530142, "relation_name": "tuva.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)))\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": [["acute_inpatient__claims_with_encounter_data"], ["acute_inpatient__professional_encounter_id"]], "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 tuva.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 tuva.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\n)\n\n\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "tuva", "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": "ebd088e091541cd15b3079f9cd9e92371e2e648ba6d9d6366553076442ab0b7f"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_id", "tags": "acute_inpatient", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3411772, "relation_name": "tuva.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)))\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 patient_id,\r\n claim_id,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__institutional_encounter_id') }}\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\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": [["acute_inpatient__institutional_encounter_id"], ["acute_inpatient__professional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "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\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 patient_id,\n claim_id,\n encounter_id,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_acute_inpatient_institutional_encounter_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n encounter_id,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "tuva", "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": "3f0ba7f0ffb340f3c524ae7a446676747762352ca7d26a2604c3e41a783752de"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "tags": "acute_inpatient", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.327498, "relation_name": "tuva.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)))\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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_encounter_id"]], "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 tuva.claims_preprocessing._int_acute_inpatient_institutional_claims aip\nleft join tuva.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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"database": "tuva", "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": "3d7f56d20d98870baaa591c2de7b47f5b56ef654638c05cd5a59eaee1f896c19"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "All acute inpatient institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_claims", "tags": "acute_inpatient", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3197944, "relation_name": "tuva.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)))\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__service_category_grouper')}} 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": [["acute_inpatient__stg_medical_claim"], ["acute_inpatient__stg_service_category__service_category_grouper"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper"]}, "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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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__service_category_grouper 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 '2023-09-05 20:45:28.914033+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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper", "sql": " __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper\n)"}]}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "tuva", "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": "1baaa1b09d4afdf40bd98eccfa3cda55d0c489532b292e686babab51ee31405e"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_encounter_id", "tags": "acute_inpatient", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3224063, "relation_name": "tuva.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)))\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 (aa.end_date + 1 = 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": [["acute_inpatient__institutional_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "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 tuva.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 (aa.end_date + 1 = 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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"database": "tuva", "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": "a87281a82f378944f9d5f0fd584a70a0199fe2c8b418c877f54ad64a2863328c"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional_encounter_id", "tags": "acute_inpatient", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3326936, "relation_name": "tuva.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)))\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 claim_id\r\nfrom {{ ref('acute_inpatient__stg_service_category__service_category_grouper') }} \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.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),\r\n\r\n\r\nacute_inpatient_professional_claim_dates as (\r\nselect\r\n claim_id,\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, 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.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 (aa.start_date between bb.encounter_start_date and bb.encounter_end_date)\r\n and (aa.end_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 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\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.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.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 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 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": [["acute_inpatient__stg_service_category__service_category_grouper"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_start_and_end_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper", "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__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),acute_inpatient_professional_claim_ids as (\nselect distinct claim_id\nfrom __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper \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.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),\n\n\nacute_inpatient_professional_claim_dates as (\nselect\n claim_id,\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, patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\nselect\n aa.patient_id,\n aa.claim_id,\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 tuva.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (aa.start_date between bb.encounter_start_date and bb.encounter_end_date)\n and (aa.end_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 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\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.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.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 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 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 *, '2023-09-05 20:45:28.914033+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__service_category_grouper", "sql": " __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "tuva", "schema": "claims_data_model", "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": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "2ff7c8bcfa4a92ed7c706b5ba9837ab9f73ace3b51ddb4a17697b0f89f532d37"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_eligibility", "tags": "acute_inpatient", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.3575287, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "c830558bd8993dcb25434dc80de7850519dc42e8c6585bcc760408af37ac8b22"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_medical_claim", "tags": "acute_inpatient", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.359635, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper": {"database": "tuva", "schema": "claims_data_model", "name": "acute_inpatient__stg_service_category__service_category_grouper", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category__service_category_grouper.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category__service_category_grouper.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_service_category__service_category_grouper"], "alias": "_stg_service_category__service_category_grouper", "checksum": {"name": "sha256", "checksum": "3676c36074683e2d13b6e3100e947b7560120103e6d2eb7a83b24b7fd4eae94f"}, "config": {"enabled": true, "alias": "_stg_service_category__service_category_grouper", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_service_category__service_category_grouper", "tags": "acute_inpatient", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.359635, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\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": [["service_category__service_category_grouper"]], "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__service_category_grouper.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__claims_without_enrollment", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "final", "claims_date_profiling__claims_without_enrollment"], "alias": "claims_without_enrollment", "checksum": {"name": "sha256", "checksum": "c554b293c33b83e1b41c8e6234ed764e68da9b489daeae16b6e9b87f2d654d0d"}, "config": {"enabled": true, "alias": "claims_without_enrollment", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "claims_without_enrollment", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5535226, "relation_name": "tuva.claims_preprocessing.claims_without_enrollment", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n 'medical claims without enrollment' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} a\r\nleft join {{ ref('eligibility') }} b\r\n on a.patient_id = b.patient_id\r\nwhere b.patient_id is null\r\n\r\nunion all\r\n\r\nselect \r\n 'rx claims without enrollment' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }} a\r\nleft join {{ ref('eligibility') }} b\r\n on a.patient_id = b.patient_id\r\nwhere b.patient_id is null", "language": "sql", "refs": [["medical_claim"], ["eligibility"], ["pharmacy_claim"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.eligibility", "model.claims_data_model.pharmacy_claim", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "compiled": true, "compiled_code": "\n\nselect \n 'medical claims without enrollment' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim a\nleft join tuva.claims_data_model.eligibility b\n on a.patient_id = b.patient_id\nwhere b.patient_id is null\n\nunion all\n\nselect \n 'rx claims without enrollment' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim a\nleft join tuva.claims_data_model.eligibility b\n on a.patient_id = b.patient_id\nwhere b.patient_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__date_issues": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__date_issues", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__date_issues", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "final", "claims_date_profiling__date_issues"], "alias": "date_issues", "checksum": {"name": "sha256", "checksum": "25f59960ed65bc53ff9990bfe215344912fe31e04df088551032706ae5f531ce"}, "config": {"enabled": true, "alias": "date_issues", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "date_issues", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5510082, "relation_name": "tuva.claims_preprocessing.date_issues", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'claim_start_date > claim_end_date' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere claim_start_date > claim_end_date\r\n\r\nunion all\r\n\r\nselect\r\n 'admission_date > discharge_date' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere admission_date > discharge_date\r\n\r\nunion all\r\n\r\nselect\r\n 'enrollment_start_date > enrollment_end_date' as test_description\r\n, count(1) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }} \r\nwhere enrollment_start_date > enrollment_end_date", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "compiled": true, "compiled_code": "\n\nselect\n 'claim_start_date > claim_end_date' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \nwhere claim_start_date > claim_end_date\n\nunion all\n\nselect\n 'admission_date > discharge_date' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \nwhere admission_date > discharge_date\n\nunion all\n\nselect\n 'enrollment_start_date > enrollment_end_date' as test_description\n, count(1) as claim_count\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility \nwhere enrollment_start_date > enrollment_end_date", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__date_summary": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__date_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__date_summary", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "final", "claims_date_profiling__date_summary"], "alias": "date_summary", "checksum": {"name": "sha256", "checksum": "76b909198cffd355de04074214501c4e5343aaddb354ffbf844b96895ab9522b"}, "config": {"enabled": true, "alias": "date_summary", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "date_summary", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5484605, "relation_name": "tuva.claims_preprocessing.date_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n coalesce(a.year_month,b.year_month) as year_month\r\n, a.claim_start_date as claim_start_date\r\n, a.claim_end_date as claim_end_date\r\n, a.admission_date as admission_date\r\n, a.discharge_date as discharge_date\r\n, a.paid_date as medical_paid_date\r\n, b.dispensing_date as dispensing_date\r\n, b.paid_date as rx_paid_date\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('claims_date_profiling__medical_claim_dates') }} a\r\nfull join {{ ref('claims_date_profiling__pharmacy_claim_dates') }} b\r\n on a.year_month = b.year_month\r\n\r\nunion all\r\n\r\nselect \r\n 'Duplicate' as year_month\r\n, c.claim_start_date\r\n, c.claim_end_date\r\n, c.admission_date\r\n, c.discharge_date\r\n, c.med_paid_date as medical_paid_date\r\n, c.dispensing_date\r\n, c.rx_paid_date\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('claims_date_profiling__duplicate_dates') }} c\r\norder by 1", "language": "sql", "refs": [["claims_date_profiling__medical_claim_dates"], ["claims_date_profiling__pharmacy_claim_dates"], ["claims_date_profiling__duplicate_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.claims_date_profiling__medical_claim_dates", "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "compiled": true, "compiled_code": "\n\nselect\n coalesce(a.year_month,b.year_month) as year_month\n, a.claim_start_date as claim_start_date\n, a.claim_end_date as claim_end_date\n, a.admission_date as admission_date\n, a.discharge_date as discharge_date\n, a.paid_date as medical_paid_date\n, b.dispensing_date as dispensing_date\n, b.paid_date as rx_paid_date\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_medical_claim_dates a\nfull join tuva.claims_preprocessing._int_pharmacy_claim_dates b\n on a.year_month = b.year_month\n\nunion all\n\nselect \n 'Duplicate' as year_month\n, c.claim_start_date\n, c.claim_end_date\n, c.admission_date\n, c.discharge_date\n, c.med_paid_date as medical_paid_date\n, c.dispensing_date\n, c.rx_paid_date\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_duplicate_dates c\norder by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__duplicate_dates": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__duplicate_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__duplicate_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "intermediate", "claims_date_profiling__duplicate_dates"], "alias": "_int_duplicate_dates", "checksum": {"name": "sha256", "checksum": "7f3fc6cdce6da981afb5382efb22597ad2a08a7573124f384125b0ec71409325"}, "config": {"enabled": true, "alias": "_int_duplicate_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_duplicate_dates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5449526, "relation_name": "tuva.claims_preprocessing._int_duplicate_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_start as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct claim_start_date) > 1\r\n)\r\n\r\n, claim_end as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct claim_end_date) > 1\r\n)\r\n\r\n, admission_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct admission_date) > 1\r\n)\r\n\r\n, discharge_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct discharge_date) > 1\r\n)\r\n\r\n, med_paid_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct paid_date) > 1\r\n)\r\n\r\n, dispensing_date as (\r\nselect claim_id\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct dispensing_date) > 1\r\n)\r\n\r\n, rx_paid_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct paid_date) > 1\r\n)\r\n\r\n, combine as (\r\nselect \r\n 'claim_start_date' as date_type\r\n, count(1) as cnt\r\nfrom claim_start\r\n\r\nunion all\r\n\r\nselect \r\n 'claim_end_date' as date_type\r\n, count(1) as cnt\r\nfrom claim_end\r\n\r\nunion all\r\n\r\nselect \r\n 'admission_date' as date_type\r\n, count(1) as cnt\r\nfrom admission_date\r\n\r\nunion all\r\n\r\nselect \r\n 'discharge_date' as date_type\r\n, count(1) as cnt\r\nfrom discharge_date\r\n\r\nunion all\r\n\r\nselect \r\n 'med_paid_date' as date_type\r\n, count(1) as cnt\r\nfrom med_paid_date\r\n\r\nunion all\r\n\r\nselect \r\n 'dispensing_date' as date_type\r\n, count(1) as cnt\r\nfrom dispensing_date\r\n\r\nunion all\r\n\r\nselect \r\n 'rx_paid_date' as date_type\r\n, count(1) as cnt\r\nfrom rx_paid_date\r\n)\r\n\r\nselect\r\n {{ dbt_utils.pivot(\r\n column='date_type'\r\n , values=('claim_start_date',\r\n 'claim_end_date',\r\n 'admission_date',\r\n 'discharge_date',\r\n 'med_paid_date',\r\n 'dispensing_date',\r\n 'rx_paid_date'\r\n )\r\n , agg='sum'\r\n , then_value='cnt'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine\r\norder by 1", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["pharmacy_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "compiled": true, "compiled_code": "\n\nwith claim_start as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct claim_start_date) > 1\n)\n\n, claim_end as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct claim_end_date) > 1\n)\n\n, admission_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct admission_date) > 1\n)\n\n, discharge_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct discharge_date) > 1\n)\n\n, med_paid_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct paid_date) > 1\n)\n\n, dispensing_date as (\nselect claim_id\nfrom tuva.claims_data_model.pharmacy_claim \ngroup by claim_id\nhaving count(distinct dispensing_date) > 1\n)\n\n, rx_paid_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct paid_date) > 1\n)\n\n, combine as (\nselect \n 'claim_start_date' as date_type\n, count(1) as cnt\nfrom claim_start\n\nunion all\n\nselect \n 'claim_end_date' as date_type\n, count(1) as cnt\nfrom claim_end\n\nunion all\n\nselect \n 'admission_date' as date_type\n, count(1) as cnt\nfrom admission_date\n\nunion all\n\nselect \n 'discharge_date' as date_type\n, count(1) as cnt\nfrom discharge_date\n\nunion all\n\nselect \n 'med_paid_date' as date_type\n, count(1) as cnt\nfrom med_paid_date\n\nunion all\n\nselect \n 'dispensing_date' as date_type\n, count(1) as cnt\nfrom dispensing_date\n\nunion all\n\nselect \n 'rx_paid_date' as date_type\n, count(1) as cnt\nfrom rx_paid_date\n)\n\nselect\n \n \n sum(\n \n case\n when date_type = 'claim_start_date'\n then cnt\n else 0\n end\n )\n \n \n as claim_start_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'claim_end_date'\n then cnt\n else 0\n end\n )\n \n \n as claim_end_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'admission_date'\n then cnt\n else 0\n end\n )\n \n \n as admission_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'discharge_date'\n then cnt\n else 0\n end\n )\n \n \n as discharge_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'med_paid_date'\n then cnt\n else 0\n end\n )\n \n \n as med_paid_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'dispensing_date'\n then cnt\n else 0\n end\n )\n \n \n as dispensing_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'rx_paid_date'\n then cnt\n else 0\n end\n )\n \n \n as rx_paid_date\n \n \n \n \n\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom combine\norder by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__medical_claim_dates": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__medical_claim_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__medical_claim_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "intermediate", "claims_date_profiling__medical_claim_dates"], "alias": "_int_medical_claim_dates", "checksum": {"name": "sha256", "checksum": "93b8e1f2ff8befb1d2c9ce0b6c950c341cb3ebb9ed0e49610743f1b916d5542e"}, "config": {"enabled": true, "alias": "_int_medical_claim_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_dates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5384545, "relation_name": "tuva.claims_preprocessing._int_medical_claim_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith med_claims as (\r\nselect\r\n min(claim_start_date) as claim_start_date\r\n, min(claim_end_date) as claim_end_date\r\n, min(admission_date) as admission_date\r\n, min(discharge_date) as discharge_date\r\n, min(paid_date) as paid_date\r\n, claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\n)\r\n\r\n, transform as (\r\nselect\r\n cast({{ date_part(\"year\",\"claim_start_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"claim_start_date\") }} as {{ dbt.type_string() }} ),2,'0') as claim_start_date\r\n, cast({{ date_part(\"year\",\"claim_end_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"claim_end_date\") }} as {{ dbt.type_string() }} ),2,'0') as claim_end_date\r\n, cast({{ date_part(\"year\",\"admission_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"admission_date\") }} as {{ dbt.type_string() }} ),2,'0') as admission_date\r\n, cast({{ date_part(\"year\",\"discharge_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"discharge_date\") }} as {{ dbt.type_string() }} ),2,'0') as discharge_date\r\n, cast({{ date_part(\"year\",\"paid_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"paid_date\") }} as {{ dbt.type_string() }} ),2,'0') as paid_date\r\n, claim_id\r\nfrom med_claims\r\n)\r\n\r\n, pivot_prep as (\r\nselect\r\n cast(claim_start_date as {{ dbt.type_string() }} ) as year_month\r\n, 'claim_start_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(claim_end_date as {{ dbt.type_string() }} ) as year_month\r\n, 'claim_end_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(admission_date as {{ dbt.type_string() }} ) as year_month\r\n, 'admission_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(discharge_date as {{ dbt.type_string() }} ) as year_month\r\n, 'discharge_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(paid_date as {{ dbt.type_string() }} ) as year_month\r\n, 'paid_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n)\r\n\r\nselect \r\nyear_month\r\n, {{ dbt_utils.pivot(\r\n column='date_type'\r\n , values=['claim_start_date','claim_end_date','admission_date','discharge_date','paid_date']\r\n , agg='sum'\r\n , quote_identifiers=false\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_prep\r\ngroup by year_month", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt_utils.pivot"], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "compiled": true, "compiled_code": "\n\nwith med_claims as (\nselect\n min(claim_start_date) as claim_start_date\n, min(claim_end_date) as claim_end_date\n, min(admission_date) as admission_date\n, min(discharge_date) as discharge_date\n, min(paid_date) as paid_date\n, claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\n)\n\n, transform as (\nselect\n cast(date_part('year', claim_start_date) as TEXT ) || lpad(cast(date_part('month', claim_start_date) as TEXT ),2,'0') as claim_start_date\n, cast(date_part('year', claim_end_date) as TEXT ) || lpad(cast(date_part('month', claim_end_date) as TEXT ),2,'0') as claim_end_date\n, cast(date_part('year', admission_date) as TEXT ) || lpad(cast(date_part('month', admission_date) as TEXT ),2,'0') as admission_date\n, cast(date_part('year', discharge_date) as TEXT ) || lpad(cast(date_part('month', discharge_date) as TEXT ),2,'0') as discharge_date\n, cast(date_part('year', paid_date) as TEXT ) || lpad(cast(date_part('month', paid_date) as TEXT ),2,'0') as paid_date\n, claim_id\nfrom med_claims\n)\n\n, pivot_prep as (\nselect\n cast(claim_start_date as TEXT ) as year_month\n, 'claim_start_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(claim_end_date as TEXT ) as year_month\n, 'claim_end_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(admission_date as TEXT ) as year_month\n, 'admission_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(discharge_date as TEXT ) as year_month\n, 'discharge_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(paid_date as TEXT ) as year_month\n, 'paid_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n)\n\nselect \nyear_month\n, \n \n sum(\n \n case\n when date_type = 'claim_start_date'\n then 1\n else 0\n end\n )\n \n \n as claim_start_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'claim_end_date'\n then 1\n else 0\n end\n )\n \n \n as claim_end_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'admission_date'\n then 1\n else 0\n end\n )\n \n \n as admission_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'discharge_date'\n then 1\n else 0\n end\n )\n \n \n as discharge_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'paid_date'\n then 1\n else 0\n end\n )\n \n \n as paid_date\n \n \n \n \n\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__pharmacy_claim_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "intermediate", "claims_date_profiling__pharmacy_claim_dates"], "alias": "_int_pharmacy_claim_dates", "checksum": {"name": "sha256", "checksum": "5ad18dd582812868c8a1c76b409a22de9523cc52a7621b7c190a7ed219a17550"}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_dates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5419624, "relation_name": "tuva.claims_preprocessing._int_pharmacy_claim_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith rx_claims as (\r\nselect\r\n min(dispensing_date) as dispensing_date\r\n, min(paid_date) as paid_date\r\n, claim_id\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by claim_id\r\n)\r\n\r\n, rx_transform as (\r\nselect\r\n cast({{ date_part(\"year\",\"dispensing_date\") }} as {{ dbt.type_string() }} ) || lpad( cast( {{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }} ) ,2,'0') as dispensing_date\r\n, cast({{ date_part(\"year\",\"paid_date\") }} as {{ dbt.type_string() }} ) || lpad( cast( {{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }} ) ,2,'0') as paid_date\r\n, claim_id\r\nfrom rx_claims\r\n)\r\n\r\n, rx_pivot_prep as (\r\nselect\r\n dispensing_date as year_month\r\n, 'dispensing_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom rx_transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n paid_date as year_month\r\n, 'paid_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom rx_transform \r\ngroup by 1,2\r\n)\r\n\r\nselect\r\nyear_month\r\n, {{ dbt_utils.pivot(\r\n column='date_type'\r\n , values=['dispensing_date','paid_date']\r\n , agg='sum'\r\n , quote_identifiers=false\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom rx_pivot_prep\r\ngroup by year_month", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt_utils.pivot"], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "compiled": true, "compiled_code": "\n\nwith rx_claims as (\nselect\n min(dispensing_date) as dispensing_date\n, min(paid_date) as paid_date\n, claim_id\nfrom tuva.claims_data_model.pharmacy_claim \ngroup by claim_id\n)\n\n, rx_transform as (\nselect\n cast(date_part('year', dispensing_date) as TEXT ) || lpad( cast( date_part('month', dispensing_date) as TEXT ) ,2,'0') as dispensing_date\n, cast(date_part('year', paid_date) as TEXT ) || lpad( cast( date_part('month', paid_date) as TEXT ) ,2,'0') as paid_date\n, claim_id\nfrom rx_claims\n)\n\n, rx_pivot_prep as (\nselect\n dispensing_date as year_month\n, 'dispensing_date' as date_type\n, count(distinct claim_id) as cnt\nfrom rx_transform \ngroup by 1,2\n\nunion all\n\nselect\n paid_date as year_month\n, 'paid_date' as date_type\n, count(distinct claim_id) as cnt\nfrom rx_transform \ngroup by 1,2\n)\n\nselect\nyear_month\n, \n \n sum(\n \n case\n when date_type = 'dispensing_date'\n then 1\n else 0\n end\n )\n \n \n as dispensing_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'paid_date'\n then 1\n else 0\n end\n )\n \n \n as paid_date\n \n \n \n \n\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom rx_pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__summary": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__summary.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__summary.sql", "unique_id": "model.the_tuva_project.data_profiling__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "5c618cfae1045c519ea0f22fcd0490f1665c15241fd5ea5b9a22f15cf17a6a42"}, "config": {"enabled": true, "alias": "summary", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test category is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed", "meta": {}, "data_type": "integer", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__summary.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "summary", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5166378, "relation_name": "tuva.claims_preprocessing.summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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) as int) as counts\r\n from {{ ref('data_profiling__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('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_profiling__medical_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__claim_type_mapping_failures' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__claim_type_unmapped' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_inst_missing_values' )}} where test_category = 'claim_type')\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} where test_category = 'claim_type')\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__institutional_header_fail_details' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__professional_header_fail_details' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__medical_claim_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__medical_claim_inst_missing_values' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} )\r\n\r\n /**** eligibility ****/\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__eligibility_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__eligibility_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__eligibility_missing_values' )}} )\r\n\r\n /**** pharmacy_claim ****/\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__pharmacy_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__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 = 'medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'medical_claim' and test_category = 'good'\r\n then '7_good' \r\n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'eligibility' and test_category = 'plausibility'\r\n then '4_plausibility' \r\n when source_table = 'eligibility' and test_category = 'good'\r\n then '5_good'\r\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility' \r\n when source_table = '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": [["data_profiling__test_detail"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__claim_type_unmapped"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_missing_values"], ["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__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) as int) as counts\n from tuva.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('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 tuva.claims_preprocessing._int_medical_claim_duplicates )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_claim_type_mapping_failures )\n and not exists (select 1 from tuva.claims_preprocessing._int_claim_type_unmapped )\n and not exists (select 1 from tuva.claims_preprocessing._int_medical_claim_inst_missing_values where test_category = 'claim_type')\n and not exists (select 1 from tuva.claims_preprocessing._int_medical_claim_prof_missing_values where test_category = 'claim_type')\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_institutional_header_fail_details )\n and not exists (select 1 from tuva.claims_preprocessing._int_professional_header_fail_details )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_medical_claim_invalid_values )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_medical_claim_inst_missing_values )\n and not exists (select 1 from tuva.claims_preprocessing._int_medical_claim_prof_missing_values )\n\n /**** eligibility ****/\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_eligibility_duplicates )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_eligibility_invalid_values )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_eligibility_missing_values )\n\n /**** pharmacy_claim ****/\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_pharmacy_claim_duplicates )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_pharmacy_claim_missing_values )\n)\n\nselect \n cast(source_table as TEXT ) as source_table\n , cast(case \n when source_table = 'medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'medical_claim' and test_category = 'good'\n then '7_good' \n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'eligibility' and test_category = 'plausibility'\n then '4_plausibility' \n when source_table = 'eligibility' and test_category = 'good'\n then '5_good'\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = 'pharmacy_claim' and test_category = 'plausibility'\n then '3_plausibility' \n when source_table = '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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_detail"], "alias": "test_detail", "checksum": {"name": "sha256", "checksum": "4f1779e900d970e05e21590d0a176554467de8011acdeb88af35a19a885844f0"}, "config": {"enabled": true, "alias": "test_detail", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_detail", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5233998, "relation_name": "tuva.claims_preprocessing.test_detail", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith test_detail_union as(\r\n\r\nselect * from {{ ref('data_profiling__test_detail_stage_medical_claim') }}\r\nunion all\r\nselect * from {{ ref('data_profiling__test_detail_stage_eligibility') }}\r\nunion all\r\nselect * from {{ ref('data_profiling__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 = 'medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'eligibility' and test_category = 'plausibility'\r\n then '4_plausibility'\r\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = '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 , claim_id as foreign_key\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom test_detail_union", "language": "sql", "refs": [["data_profiling__test_detail_stage_medical_claim"], ["data_profiling__test_detail_stage_eligibility"], ["data_profiling__test_detail_stage_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "compiled": true, "compiled_code": "\n\nwith test_detail_union as(\n\nselect * from tuva.claims_preprocessing._int_test_detail_stage_medical_claim\nunion all\nselect * from tuva.claims_preprocessing._int_test_detail_stage_eligibility\nunion all\nselect * from tuva.claims_preprocessing._int_test_detail_stage_pharmacy_claim\n\n\n)\n\nselect \n source_table\n , case \n when source_table = 'medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'eligibility' and test_category = 'plausibility'\n then '4_plausibility'\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = '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 , claim_id as foreign_key\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_result"], "alias": "test_result", "checksum": {"name": "sha256", "checksum": "e3e47acca220ab867995a28e451c6637feb732a6e7d27972703bfef69c144bc2"}, "config": {"enabled": true, "alias": "test_result", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_result", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.529396, "relation_name": "tuva.claims_preprocessing.test_result", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_eligibility') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_pharmacy_claim') }}", "language": "sql", "refs": [["data_profiling__test_result_stage_medical_claim"], ["data_profiling__test_result_stage_eligibility"], ["data_profiling__test_result_stage_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.claims_preprocessing._int_test_result_stage_medical_claim\n\nunion all\n\nselect * from tuva.claims_preprocessing._int_test_result_stage_eligibility\n\nunion all\n\nselect * from tuva.claims_preprocessing._int_test_result_stage_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__use_case": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__use_case", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__use_case.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__use_case.sql", "unique_id": "model.the_tuva_project.data_profiling__use_case", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__use_case"], "alias": "use_case", "checksum": {"name": "sha256", "checksum": "1d8c2a667917a846a9b1780b0345d8da36b9da9a2d63d37e8a17fe1246ce5d63"}, "config": {"enabled": true, "alias": "use_case", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"use_case": {"name": "use_case", "description": "The mart or logic that would be affected by test failures", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__use_case.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "use_case", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5344403, "relation_name": "tuva.claims_preprocessing.use_case", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }}) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct patient_id) from {{ ref('eligibility') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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": [["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"], ["eligibility"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.eligibility", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.pharmacy_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct patient_id) from tuva.claims_data_model.eligibility ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.pharmacy_claim ) as denominator\n from tuva.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 = 'pharmacy_claim'\n group by\n source_table\n , test_name\n)\n\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__claim_type_mapping_failures": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__claim_type_mapping_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "unique_id": "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__claim_type_mapping_failures"], "alias": "_int_claim_type_mapping_failures", "checksum": {"name": "sha256", "checksum": "3d19c09bd9c3bdca878144171bd0c52eafa8b7db6b242e2d420ddab45b21088b"}, "config": {"enabled": true, "alias": "_int_claim_type_mapping_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_mapping_failures", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4241571, "relation_name": "tuva.claims_preprocessing._int_claim_type_mapping_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_type_mapping as(\r\n select \r\n claim_id\r\n , claim_line_number\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('medical_claim') }} \r\n )\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'claim_type' as test_category\r\n , 'claim_type mapping incorrect' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_type_mapping\r\nwhere source_claim_type <> data_profiling_claim_type\r\ngroup by\r\n claim_id", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "compiled": true, "compiled_code": "\n\nwith claim_type_mapping as(\n select \n claim_id\n , claim_line_number\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 tuva.claims_data_model.medical_claim \n )\n\nselect\n 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'claim_type' as test_category\n , 'claim_type mapping incorrect' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom claim_type_mapping\nwhere source_claim_type <> data_profiling_claim_type\ngroup by\n claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__claim_type_unmapped", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "unique_id": "model.the_tuva_project.data_profiling__claim_type_unmapped", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__claim_type_unmapped"], "alias": "_int_claim_type_unmapped", "checksum": {"name": "sha256", "checksum": "568b4dd3e023834e99f28d9322721d93cd2ddc70a1de05c3684303d33b025968"}, "config": {"enabled": true, "alias": "_int_claim_type_unmapped", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_unmapped", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.368656, "relation_name": "tuva.claims_preprocessing._int_claim_type_unmapped", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'claim_type' as test_category\r\n , 'claim_type missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere claim_type is null\r\ngroup by\r\n claim_id", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "compiled": true, "compiled_code": "\n\nselect\n 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'claim_type' as test_category\n , 'claim_type missing' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \nwhere claim_type is null\ngroup by\n claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_denominators": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_denominators", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_denominators"], "alias": "_int_eligibility_denominators", "checksum": {"name": "sha256", "checksum": "31ab3c529e96e3ac469dffef9da2b497a7dfcd38075bd032847e302145e98688"}, "config": {"enabled": true, "alias": "_int_eligibility_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_denominators", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4841223, "relation_name": "tuva.claims_preprocessing._int_eligibility_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith all_denominator as(\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('eligibility') }}\r\n)\r\n, gender_denominator as(\r\n select\r\n cast('gender invalid' 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('eligibility') }}\r\n where gender is not null\r\n)\r\n, race_denominator as(\r\n select\r\n cast('race invalid' 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('eligibility') }}\r\n where race is not null\r\n)\r\n, payer_type_denominator as(\r\n select\r\n cast('payer_type invalid' 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('eligibility') }}\r\n where payer_type is not null\r\n)\r\n, dual_status_denominator as(\r\n select\r\n cast('dual_status_code invalid' 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('eligibility') }}\r\n where dual_status_code is not null\r\n)\r\n, medicare_status_denominator as(\r\n select\r\n cast('medicare_status_code invalid' 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('eligibility') }}\r\n where medicare_status_code is not null\r\n)\r\nselect * from all_denominator\r\nunion all\r\nselect * from gender_denominator\r\nunion all \r\nselect * from race_denominator\r\nunion all \r\nselect * from payer_type_denominator\r\nunion all \r\nselect * from dual_status_denominator\r\nunion all \r\nselect * from medicare_status_denominator", "language": "sql", "refs": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "compiled": true, "compiled_code": "\n\nwith all_denominator as(\n select\n cast('all' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n)\n, gender_denominator as(\n select\n cast('gender invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where gender is not null\n)\n, race_denominator as(\n select\n cast('race invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where race is not null\n)\n, payer_type_denominator as(\n select\n cast('payer_type invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where payer_type is not null\n)\n, dual_status_denominator as(\n select\n cast('dual_status_code invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where dual_status_code is not null\n)\n, medicare_status_denominator as(\n select\n cast('medicare_status_code invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where medicare_status_code is not null\n)\nselect * from all_denominator\nunion all\nselect * from gender_denominator\nunion all \nselect * from race_denominator\nunion all \nselect * from payer_type_denominator\nunion all \nselect * from dual_status_denominator\nunion all \nselect * from medicare_status_denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_duplicates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_duplicates"], "alias": "_int_eligibility_duplicates", "checksum": {"name": "sha256", "checksum": "939ace4215eac13b6fd9cd27ff3a10a6b37cbec84cbdf84873bea62837992420"}, "config": {"enabled": true, "alias": "_int_eligibility_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_duplicates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4592495, "relation_name": "tuva.claims_preprocessing._int_eligibility_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate eligibility' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }} \r\ngroup by\r\n patient_id\r\n , member_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\nhaving count(*) > 1", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n 'eligibility' as source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , patient_id \n , 'duplicate_values' as test_category\n , 'duplicate eligibility' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility \ngroup by\n patient_id\n , member_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_invalid_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_invalid_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_invalid_values"], "alias": "_int_eligibility_invalid_values", "checksum": {"name": "sha256", "checksum": "a539dff7e28701b0ee64df658b6eeff52258ae09b2af04a35effb41690ba44b7"}, "config": {"enabled": true, "alias": "_int_eligibility_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_invalid_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.459898, "relation_name": "tuva.claims_preprocessing._int_eligibility_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith valid_gender as(\r\n select\r\n 'gender invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.gender\r\n , count(elig.gender) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__gender') }} gender\r\n on elig.gender = gender.gender\r\n where gender.gender is null\r\n and elig.gender is not null\r\n group by\r\n patient_id\r\n , elig.gender\r\n)\r\n, valid_race as(\r\n select\r\n 'race invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.race\r\n , count(elig.race) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__race') }} race\r\n on elig.race = race.description\r\n where race.description is null\r\n and elig.race is not null\r\n group by\r\n patient_id\r\n , elig.race\r\n)\r\n, valid_payer_type as(\r\n select\r\n 'payer_type invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.payer_type\r\n , count(elig.payer_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__payer_type') }} payer\r\n on elig.payer_type = payer.payer_type\r\n where payer.payer_type is null\r\n and elig.payer_type is not null\r\n group by\r\n patient_id\r\n , elig.payer_type\r\n)\r\n, valid_dual_status_code as(\r\n select\r\n 'dual_status_code invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.dual_status_code\r\n , count(elig.dual_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__medicare_dual_eligibility') }} dual\r\n on elig.dual_status_code = dual.dual_status_code\r\n where dual.dual_status_code is null\r\n and elig.dual_status_code is not null\r\n group by\r\n patient_id\r\n , elig.dual_status_code\r\n)\r\n, valid_medicare_status_code as(\r\n select\r\n 'medicare_status_code invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.medicare_status_code\r\n , count(elig.medicare_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__medicare_status') }} status\r\n on elig.medicare_status_code = status.medicare_status_code\r\n where status.medicare_status_code is null\r\n and elig.medicare_status_code is not null\r\n group by\r\n patient_id\r\n , elig.medicare_status_code\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_dual_status_code\r\nunion all\r\nselect * from valid_medicare_status_code", "language": "sql", "refs": [["eligibility"], ["terminology__gender"], ["eligibility"], ["terminology__race"], ["eligibility"], ["terminology__payer_type"], ["eligibility"], ["terminology__medicare_dual_eligibility"], ["eligibility"], ["terminology__medicare_status"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__gender", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__race", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__payer_type", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__medicare_status"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith valid_gender as(\n select\n 'gender invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.gender\n , count(elig.gender) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.gender gender\n on elig.gender = gender.gender\n where gender.gender is null\n and elig.gender is not null\n group by\n patient_id\n , elig.gender\n)\n, valid_race as(\n select\n 'race invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.race\n , count(elig.race) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.race race\n on elig.race = race.description\n where race.description is null\n and elig.race is not null\n group by\n patient_id\n , elig.race\n)\n, valid_payer_type as(\n select\n 'payer_type invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.payer_type\n , count(elig.payer_type) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.payer_type payer\n on elig.payer_type = payer.payer_type\n where payer.payer_type is null\n and elig.payer_type is not null\n group by\n patient_id\n , elig.payer_type\n)\n, valid_dual_status_code as(\n select\n 'dual_status_code invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.dual_status_code\n , count(elig.dual_status_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.medicare_dual_eligibility dual\n on elig.dual_status_code = dual.dual_status_code\n where dual.dual_status_code is null\n and elig.dual_status_code is not null\n group by\n patient_id\n , elig.dual_status_code\n)\n, valid_medicare_status_code as(\n select\n 'medicare_status_code invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.medicare_status_code\n , count(elig.medicare_status_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.medicare_status status\n on elig.medicare_status_code = status.medicare_status_code\n where status.medicare_status_code is null\n and elig.medicare_status_code is not null\n group by\n patient_id\n , elig.medicare_status_code\n)\nselect * from valid_gender\nunion all\nselect * from valid_race\nunion all\nselect * from valid_payer_type\nunion all\nselect * from valid_dual_status_code\nunion all\nselect * from valid_medicare_status_code", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_missing_values"], "alias": "_int_eligibility_missing_values", "checksum": {"name": "sha256", "checksum": "67cf90c8c09eee508dd7724b5744f1169d200c487d429544906e46b4919303aa"}, "config": {"enabled": true, "alias": "_int_eligibility_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4722407, "relation_name": "tuva.claims_preprocessing._int_eligibility_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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\n\r\n\r\nwith eligibility_missing as(\r\n\r\n {{ eligibility_missing_column_check(builtins.ref('eligibility'), eligibility_missing_column_list) }}\r\n\r\n)\r\n\r\n\r\nselect\r\n 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\ngroup by\r\n patient_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.eligibility_missing_column_check"], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith eligibility_missing as(\n\n \n select\n patient_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.eligibility\n where patient_id is null\n union all\n select\n patient_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.eligibility\n where member_id is null\n union all\n select\n patient_id\n , 'gender' as column_checked\n from tuva.claims_data_model.eligibility\n where gender is null\n union all\n select\n patient_id\n , 'race' as column_checked\n from tuva.claims_data_model.eligibility\n where race is null\n union all\n select\n patient_id\n , 'birth_date' as column_checked\n from tuva.claims_data_model.eligibility\n where birth_date is null\n union all\n select\n patient_id\n , 'death_date' as column_checked\n from tuva.claims_data_model.eligibility\n where death_date is null\n union all\n select\n patient_id\n , 'death_flag' as column_checked\n from tuva.claims_data_model.eligibility\n where death_flag is null\n union all\n select\n patient_id\n , 'enrollment_start_date' as column_checked\n from tuva.claims_data_model.eligibility\n where enrollment_start_date is null\n union all\n select\n patient_id\n , 'enrollment_end_date' as column_checked\n from tuva.claims_data_model.eligibility\n where enrollment_end_date is null\n union all\n select\n patient_id\n , 'payer' as column_checked\n from tuva.claims_data_model.eligibility\n where payer is null\n union all\n select\n patient_id\n , 'payer_type' as column_checked\n from tuva.claims_data_model.eligibility\n where payer_type is null\n union all\n select\n patient_id\n , 'dual_status_code' as column_checked\n from tuva.claims_data_model.eligibility\n where dual_status_code is null\n union all\n select\n patient_id\n , 'medicare_status_code' as column_checked\n from tuva.claims_data_model.eligibility\n where medicare_status_code is null\n union all\n select\n patient_id\n , 'first_name' as column_checked\n from tuva.claims_data_model.eligibility\n where first_name is null\n union all\n select\n patient_id\n , 'last_name' as column_checked\n from tuva.claims_data_model.eligibility\n where last_name is null\n union all\n select\n patient_id\n , 'address' as column_checked\n from tuva.claims_data_model.eligibility\n where address is null\n union all\n select\n patient_id\n , 'city' as column_checked\n from tuva.claims_data_model.eligibility\n where city is null\n union all\n select\n patient_id\n , 'state' as column_checked\n from tuva.claims_data_model.eligibility\n where state is null\n union all\n select\n patient_id\n , 'zip_code' as column_checked\n from tuva.claims_data_model.eligibility\n where zip_code is null\n union all\n select\n patient_id\n , 'phone' as column_checked\n from tuva.claims_data_model.eligibility\n where phone is null\n union all\n select\n patient_id\n , 'data_source' as column_checked\n from tuva.claims_data_model.eligibility\n where data_source is null\n \n\n)\n\n\nselect\n 'eligibility' as source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , patient_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n patient_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_plausibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_plausibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_plausibility"], "alias": "_int_eligibility_plausibility", "checksum": {"name": "sha256", "checksum": "dfe1e7b7daade6b60b640a74dc25ccd67f9d42d1e85816eb09b5208f50998046"}, "config": {"enabled": true, "alias": "_int_eligibility_plausibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_plausibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4888873, "relation_name": "tuva.claims_preprocessing._int_eligibility_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith multiple_genders_test as (\r\n select\r\n 'multiple genders' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct gender) > 1\r\n)\r\n, multiple_races_test as(\r\n select\r\n 'multiple races' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} \r\n group by\r\n patient_id\r\n having count(distinct race) > 1\r\n)\r\n, multiple_birth_dates_test as(\r\n select\r\n 'multiple birth dates' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct birth_date) > 1\r\n)\r\n, multiple_death_dates_test as(\r\n select\r\n 'multiple death dates' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct death_date) > 1\r\n)\r\n, birth_date_after_death_date as(\r\n select\r\n 'birth date after death date' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n where birth_date > death_date\r\n group by\r\n patient_id\r\n having count(distinct gender) > 1\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": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith multiple_genders_test as (\n select\n 'multiple genders' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n group by\n patient_id\n having count(distinct gender) > 1\n)\n, multiple_races_test as(\n select\n 'multiple races' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility \n group by\n patient_id\n having count(distinct race) > 1\n)\n, multiple_birth_dates_test as(\n select\n 'multiple birth dates' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n group by\n patient_id\n having count(distinct birth_date) > 1\n)\n, multiple_death_dates_test as(\n select\n 'multiple death dates' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n group by\n patient_id\n having count(distinct death_date) > 1\n)\n, birth_date_after_death_date as(\n select\n 'birth date after death date' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where birth_date > death_date\n group by\n patient_id\n having count(distinct gender) > 1\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": []}, "model.the_tuva_project.data_profiling__institutional_header_failures": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__institutional_header_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "unique_id": "model.the_tuva_project.data_profiling__institutional_header_failures", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_failures"], "alias": "_int_institutional_header_failures", "checksum": {"name": "sha256", "checksum": "5e058b75ff1a328677ee6f83936fec20d76a2eb29f2b39eee11bd3036b0fb18a"}, "config": {"enabled": true, "alias": "_int_institutional_header_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_failures", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.3722198, "relation_name": "tuva.claims_preprocessing._int_institutional_header_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith stage as(\r\n select distinct\r\n claim_id\r\n , claim_type\r\n , patient_id\r\n , member_id\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 from {{ ref('medical_claim') }} \r\n where claim_type = 'institutional'\r\n ) \r\n, claims_with_duplicates as (\r\nselect \r\n claim_id\r\n , 1 as invalid_header\r\nfrom stage\r\ngroup by claim_id\r\nhaving count(*) > 1\r\n)\r\n\r\nselect med.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\r\ninner join {{ ref('medical_claim') }} med\r\n on dupe.claim_id = med.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "compiled": true, "compiled_code": "\n\nwith stage as(\n select distinct\n claim_id\n , claim_type\n , patient_id\n , member_id\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , bill_type_code\n , ms_drg_code\n , facility_npi\n , billing_npi\n , rendering_npi\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 from tuva.claims_data_model.medical_claim \n where claim_type = 'institutional'\n ) \n, claims_with_duplicates as (\nselect \n claim_id\n , 1 as invalid_header\nfrom stage\ngroup by claim_id\nhaving count(*) > 1\n)\n\nselect med.*, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run from claims_with_duplicates dupe\ninner join tuva.claims_data_model.medical_claim med\n on dupe.claim_id = med.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__institutional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_fail_details"], "alias": "_int_institutional_header_fail_details", "checksum": {"name": "sha256", "checksum": "2438594d9d3c5c5d9d277e44bf079790c55a44c0f55e560e9c851002224a9b50"}, "config": {"enabled": true, "alias": "_int_institutional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_fail_details", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.379228, "relation_name": "tuva.claims_preprocessing._int_institutional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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 {{ header_duplicate_check(builtins.ref('data_profiling__institutional_header_failures'), institutional_header_column_list, 'institutional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , 'header' as test_category\r\n , column_checked||' duplicated' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_header_duplicates\r\ngroup by \r\n claim_id\r\n , column_checked||' duplicated'", "language": "sql", "refs": [["data_profiling__institutional_header_failures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_failures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith institutional_header_duplicates as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , 'admission_date' as column_checked\n , count(distinct admission_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct admission_date) > 1\n union all\n select\n claim_id\n , 'discharge_date' as column_checked\n , count(distinct discharge_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct discharge_date) > 1\n union all\n select\n claim_id\n , 'admit_source_code' as column_checked\n , count(distinct admit_source_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct admit_source_code) > 1\n union all\n select\n claim_id\n , 'admit_type_code' as column_checked\n , count(distinct admit_type_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct admit_type_code) > 1\n union all\n select\n claim_id\n , 'discharge_disposition_code' as column_checked\n , count(distinct discharge_disposition_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct discharge_disposition_code) > 1\n union all\n select\n claim_id\n , 'bill_type_code' as column_checked\n , count(distinct bill_type_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct bill_type_code) > 1\n union all\n select\n claim_id\n , 'ms_drg_code' as column_checked\n , count(distinct ms_drg_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct ms_drg_code) > 1\n union all\n select\n claim_id\n , 'facility_npi' as column_checked\n , count(distinct facility_npi) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct facility_npi) > 1\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , 'rendering_npi' as column_checked\n , count(distinct rendering_npi) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct rendering_npi) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_1' as column_checked\n , count(distinct diagnosis_poa_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_1) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_2' as column_checked\n , count(distinct diagnosis_poa_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_2) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_3' as column_checked\n , count(distinct diagnosis_poa_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_3) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_4' as column_checked\n , count(distinct diagnosis_poa_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_4) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_5' as column_checked\n , count(distinct diagnosis_poa_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_5) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_6' as column_checked\n , count(distinct diagnosis_poa_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_6) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_7' as column_checked\n , count(distinct diagnosis_poa_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_7) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_8' as column_checked\n , count(distinct diagnosis_poa_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_8) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_9' as column_checked\n , count(distinct diagnosis_poa_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_9) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_10' as column_checked\n , count(distinct diagnosis_poa_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_10) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_11' as column_checked\n , count(distinct diagnosis_poa_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_11) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_12' as column_checked\n , count(distinct diagnosis_poa_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_12) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_13' as column_checked\n , count(distinct diagnosis_poa_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_13) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_14' as column_checked\n , count(distinct diagnosis_poa_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_14) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_15' as column_checked\n , count(distinct diagnosis_poa_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_15) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_16' as column_checked\n , count(distinct diagnosis_poa_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_16) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_17' as column_checked\n , count(distinct diagnosis_poa_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_17) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_18' as column_checked\n , count(distinct diagnosis_poa_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_18) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_19' as column_checked\n , count(distinct diagnosis_poa_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_19) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_20' as column_checked\n , count(distinct diagnosis_poa_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_20) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_21' as column_checked\n , count(distinct diagnosis_poa_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_21) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_22' as column_checked\n , count(distinct diagnosis_poa_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_22) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_23' as column_checked\n , count(distinct diagnosis_poa_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_23) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_24' as column_checked\n , count(distinct diagnosis_poa_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_24) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_25' as column_checked\n , count(distinct diagnosis_poa_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_25) > 1\n union all\n select\n claim_id\n , 'procedure_code_type' as column_checked\n , count(distinct procedure_code_type) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_type) > 1\n union all\n select\n claim_id\n , 'procedure_code_1' as column_checked\n , count(distinct procedure_code_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_1) > 1\n union all\n select\n claim_id\n , 'procedure_code_2' as column_checked\n , count(distinct procedure_code_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_2) > 1\n union all\n select\n claim_id\n , 'procedure_code_3' as column_checked\n , count(distinct procedure_code_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_3) > 1\n union all\n select\n claim_id\n , 'procedure_code_4' as column_checked\n , count(distinct procedure_code_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_4) > 1\n union all\n select\n claim_id\n , 'procedure_code_5' as column_checked\n , count(distinct procedure_code_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_5) > 1\n union all\n select\n claim_id\n , 'procedure_code_6' as column_checked\n , count(distinct procedure_code_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_6) > 1\n union all\n select\n claim_id\n , 'procedure_code_7' as column_checked\n , count(distinct procedure_code_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_7) > 1\n union all\n select\n claim_id\n , 'procedure_code_8' as column_checked\n , count(distinct procedure_code_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_8) > 1\n union all\n select\n claim_id\n , 'procedure_code_9' as column_checked\n , count(distinct procedure_code_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_9) > 1\n union all\n select\n claim_id\n , 'procedure_code_10' as column_checked\n , count(distinct procedure_code_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_10) > 1\n union all\n select\n claim_id\n , 'procedure_code_11' as column_checked\n , count(distinct procedure_code_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_11) > 1\n union all\n select\n claim_id\n , 'procedure_code_12' as column_checked\n , count(distinct procedure_code_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_12) > 1\n union all\n select\n claim_id\n , 'procedure_code_13' as column_checked\n , count(distinct procedure_code_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_13) > 1\n union all\n select\n claim_id\n , 'procedure_code_14' as column_checked\n , count(distinct procedure_code_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_14) > 1\n union all\n select\n claim_id\n , 'procedure_code_15' as column_checked\n , count(distinct procedure_code_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_15) > 1\n union all\n select\n claim_id\n , 'procedure_code_16' as column_checked\n , count(distinct procedure_code_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_16) > 1\n union all\n select\n claim_id\n , 'procedure_code_17' as column_checked\n , count(distinct procedure_code_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_17) > 1\n union all\n select\n claim_id\n , 'procedure_code_18' as column_checked\n , count(distinct procedure_code_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_18) > 1\n union all\n select\n claim_id\n , 'procedure_code_19' as column_checked\n , count(distinct procedure_code_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_19) > 1\n union all\n select\n claim_id\n , 'procedure_code_20' as column_checked\n , count(distinct procedure_code_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_20) > 1\n union all\n select\n claim_id\n , 'procedure_code_21' as column_checked\n , count(distinct procedure_code_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_21) > 1\n union all\n select\n claim_id\n , 'procedure_code_22' as column_checked\n , count(distinct procedure_code_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_22) > 1\n union all\n select\n claim_id\n , 'procedure_code_23' as column_checked\n , count(distinct procedure_code_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_23) > 1\n union all\n select\n claim_id\n , 'procedure_code_24' as column_checked\n , count(distinct procedure_code_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_24) > 1\n union all\n select\n claim_id\n , 'procedure_code_25' as column_checked\n , count(distinct procedure_code_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_25) > 1\n union all\n select\n claim_id\n , 'procedure_date_1' as column_checked\n , count(distinct procedure_date_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_1) > 1\n union all\n select\n claim_id\n , 'procedure_date_2' as column_checked\n , count(distinct procedure_date_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_2) > 1\n union all\n select\n claim_id\n , 'procedure_date_3' as column_checked\n , count(distinct procedure_date_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_3) > 1\n union all\n select\n claim_id\n , 'procedure_date_4' as column_checked\n , count(distinct procedure_date_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_4) > 1\n union all\n select\n claim_id\n , 'procedure_date_5' as column_checked\n , count(distinct procedure_date_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_5) > 1\n union all\n select\n claim_id\n , 'procedure_date_6' as column_checked\n , count(distinct procedure_date_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_6) > 1\n union all\n select\n claim_id\n , 'procedure_date_7' as column_checked\n , count(distinct procedure_date_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_7) > 1\n union all\n select\n claim_id\n , 'procedure_date_8' as column_checked\n , count(distinct procedure_date_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_8) > 1\n union all\n select\n claim_id\n , 'procedure_date_9' as column_checked\n , count(distinct procedure_date_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_9) > 1\n union all\n select\n claim_id\n , 'procedure_date_10' as column_checked\n , count(distinct procedure_date_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_10) > 1\n union all\n select\n claim_id\n , 'procedure_date_11' as column_checked\n , count(distinct procedure_date_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_11) > 1\n union all\n select\n claim_id\n , 'procedure_date_12' as column_checked\n , count(distinct procedure_date_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_12) > 1\n union all\n select\n claim_id\n , 'procedure_date_13' as column_checked\n , count(distinct procedure_date_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_13) > 1\n union all\n select\n claim_id\n , 'procedure_date_14' as column_checked\n , count(distinct procedure_date_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_14) > 1\n union all\n select\n claim_id\n , 'procedure_date_15' as column_checked\n , count(distinct procedure_date_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_15) > 1\n union all\n select\n claim_id\n , 'procedure_date_16' as column_checked\n , count(distinct procedure_date_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_16) > 1\n union all\n select\n claim_id\n , 'procedure_date_17' as column_checked\n , count(distinct procedure_date_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_17) > 1\n union all\n select\n claim_id\n , 'procedure_date_18' as column_checked\n , count(distinct procedure_date_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_18) > 1\n union all\n select\n claim_id\n , 'procedure_date_19' as column_checked\n , count(distinct procedure_date_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_19) > 1\n union all\n select\n claim_id\n , 'procedure_date_20' as column_checked\n , count(distinct procedure_date_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_20) > 1\n union all\n select\n claim_id\n , 'procedure_date_21' as column_checked\n , count(distinct procedure_date_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_21) > 1\n union all\n select\n claim_id\n , 'procedure_date_22' as column_checked\n , count(distinct procedure_date_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_22) > 1\n union all\n select\n claim_id\n , 'procedure_date_23' as column_checked\n , count(distinct procedure_date_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_23) > 1\n union all\n select\n claim_id\n , 'procedure_date_24' as column_checked\n , count(distinct procedure_date_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_24) > 1\n union all\n select\n claim_id\n , 'procedure_date_25' as column_checked\n , count(distinct procedure_date_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_25) > 1\n union all\n select\n claim_id\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct data_source) > 1\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , claim_id\n , 'header' as test_category\n , column_checked||' duplicated' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom institutional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_denominators": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_denominators"], "alias": "_int_medical_claim_denominators", "checksum": {"name": "sha256", "checksum": "ca1857f87248fede22aa2d9babcf31d46a5cfb86bd7afe67c21b8826359f2bca"}, "config": {"enabled": true, "alias": "_int_medical_claim_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_denominators", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.43974, "relation_name": "tuva.claims_preprocessing._int_medical_claim_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith professional_denominator as(\r\n select \r\n cast('professional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , cast(count(distinct claim_id) as int) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'professional'\r\n)\r\n\r\n, institutional_denominator as(\r\n select \r\n cast('institutional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'institutional'\r\n)\r\n\r\n, all_claim_denominator as(\r\n select \r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type is not null\r\n)\r\n\r\n, bill_type_denominator as(\r\n select\r\n cast('bill_type_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where bill_type_code is not null\r\n)\r\n\r\n, revenue_center_denominator as(\r\n select\r\n cast('revenue_center_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where revenue_center_code is not null\r\n)\r\n\r\n, discharge_disposition_denominator as(\r\n select\r\n cast('discharge_disposition_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where discharge_disposition_code is not null\r\n)\r\n, admit_source_denominator as( \r\n select\r\n cast('admit_source_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where admit_source_code is not null\r\n)\r\n\r\n, admit_type_denominator as(\r\n select\r\n cast('admit_type_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where admit_type_code is not null\r\n)\r\n\r\n, ms_drg_denominator as(\r\n select\r\n cast('ms_drg_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where ms_drg_code is not null\r\n)\r\n, present_on_admission_denominator as(\r\n select\r\n cast('diagnosis_poa_1 invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_poa_1 is not null\r\n)\r\n\r\n, procedure_code_type_denominator as(\r\n select\r\n cast('procedure_code_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where procedure_code_type is not null\r\n)\r\n, place_of_service_denominator as(\r\n select\r\n cast('place_of_service_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where place_of_service_code is not null\r\n)\r\n, diagnosis_code_type_denominator as(\r\n select\r\n cast('diagnosis_code_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_code_type is not null\r\n)\r\n\r\n, diagnosis_code_denominator as(\r\n select\r\n cast('diagnosis_code_1 invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_code_1 is not null\r\n\r\n)\r\n\r\n, claim_type_denominator as(\r\n select\r\n cast('claim_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type is not null\r\n)\r\n\r\nselect * from institutional_denominator\r\nunion all \r\nselect * from professional_denominator\r\nunion all\r\nselect * from bill_type_denominator\r\nunion all\r\nselect * from revenue_center_denominator\r\nunion all\r\nselect * from discharge_disposition_denominator\r\nunion all\r\nselect * from admit_source_denominator\r\nunion all\r\nselect * from admit_type_denominator\r\nunion all\r\nselect * from ms_drg_denominator\r\nunion all\r\nselect * from present_on_admission_denominator\r\nunion all\r\nselect * from procedure_code_type_denominator\r\nunion all\r\nselect * from place_of_service_denominator\r\nunion all\r\nselect * from diagnosis_code_type_denominator\r\nunion all\r\nselect * from diagnosis_code_denominator\r\nunion all\r\nselect * from claim_type_denominator", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "compiled": true, "compiled_code": "\n\nwith professional_denominator as(\n select \n cast('professional' as TEXT ) as test_denominator_name\n , cast(count(distinct claim_id) as int) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type = 'professional'\n)\n\n, institutional_denominator as(\n select \n cast('institutional' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type = 'institutional'\n)\n\n, all_claim_denominator as(\n select \n cast('all' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type is not null\n)\n\n, bill_type_denominator as(\n select\n cast('bill_type_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where bill_type_code is not null\n)\n\n, revenue_center_denominator as(\n select\n cast('revenue_center_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where revenue_center_code is not null\n)\n\n, discharge_disposition_denominator as(\n select\n cast('discharge_disposition_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where discharge_disposition_code is not null\n)\n, admit_source_denominator as( \n select\n cast('admit_source_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where admit_source_code is not null\n)\n\n, admit_type_denominator as(\n select\n cast('admit_type_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where admit_type_code is not null\n)\n\n, ms_drg_denominator as(\n select\n cast('ms_drg_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where ms_drg_code is not null\n)\n, present_on_admission_denominator as(\n select\n cast('diagnosis_poa_1 invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where diagnosis_poa_1 is not null\n)\n\n, procedure_code_type_denominator as(\n select\n cast('procedure_code_type invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where procedure_code_type is not null\n)\n, place_of_service_denominator as(\n select\n cast('place_of_service_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where place_of_service_code is not null\n)\n, diagnosis_code_type_denominator as(\n select\n cast('diagnosis_code_type invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_type is not null\n)\n\n, diagnosis_code_denominator as(\n select\n cast('diagnosis_code_1 invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_1 is not null\n\n)\n\n, claim_type_denominator as(\n select\n cast('claim_type invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type is not null\n)\n\nselect * from institutional_denominator\nunion all \nselect * from professional_denominator\nunion all\nselect * from bill_type_denominator\nunion all\nselect * from revenue_center_denominator\nunion all\nselect * from discharge_disposition_denominator\nunion all\nselect * from admit_source_denominator\nunion all\nselect * from admit_type_denominator\nunion all\nselect * from ms_drg_denominator\nunion all\nselect * from present_on_admission_denominator\nunion all\nselect * from procedure_code_type_denominator\nunion all\nselect * from place_of_service_denominator\nunion all\nselect * from diagnosis_code_type_denominator\nunion all\nselect * from diagnosis_code_denominator\nunion all\nselect * from claim_type_denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_duplicates": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_duplicates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_duplicates"], "alias": "_int_medical_claim_duplicates", "checksum": {"name": "sha256", "checksum": "0da95ed131911d0ade24100da80c0c405d1e32f5c9dd245ed3120eeed2ee586c"}, "config": {"enabled": true, "alias": "_int_medical_claim_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_duplicates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4284432, "relation_name": "tuva.claims_preprocessing._int_medical_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate medical claims' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\ngroup by\r\n claim_id\r\n , claim_line_number\r\nhaving count(*) > 1", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'duplicate_values' as test_category\n , 'duplicate medical claims' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_inst_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_inst_missing_values"], "alias": "_int_medical_claim_inst_missing_values", "checksum": {"name": "sha256", "checksum": "81b2da440c25c7e031f8a529e10fbff0d6309612a5494fc6a4ec84c4206584c1"}, "config": {"enabled": true, "alias": "_int_medical_claim_inst_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_inst_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4056077, "relation_name": "tuva.claims_preprocessing._int_medical_claim_inst_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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('medical_claim'), institutional_missing_column_list, 'institutional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith institutional_missing as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'claim_line_number' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_line_number is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where patient_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where member_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_start_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_end_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'bill_type_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where bill_type_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'revenue_center_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where revenue_center_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'hcpcs_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where hcpcs_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'rendering_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where rendering_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where billing_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'facility_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where facility_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'paid_amount' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_amount is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_type is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n from tuva.claims_data_model.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' as column_checked\n from tuva.claims_data_model.medical_claim\n where data_source is null\n and claim_type = 'institutional'\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom institutional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_invalid_values"], "alias": "_int_medical_claim_invalid_values", "checksum": {"name": "sha256", "checksum": "e48a9657319e8baeab0e5afacdf330208a96dd82df052949ebcb28e4eb533854"}, "config": {"enabled": true, "alias": "_int_medical_claim_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_invalid_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.3988848, "relation_name": "tuva.claims_preprocessing._int_medical_claim_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith valid_bill_type as(\r\n select\r\n 'bill_type_code invalid' as test_name\r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.bill_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__bill_type')}} tob\r\n on med.bill_type_code = tob.bill_type_code\r\n where med.claim_type = 'institutional'\r\n and tob.bill_type_code is null\r\n and med.bill_type_code is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n, valid_revenue_center as(\r\n select \r\n 'revenue_center_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.revenue_center_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__revenue_center') }} rev\r\n on med.revenue_center_code = rev.revenue_center_code\r\n where med.claim_type = 'institutional'\r\n and rev.revenue_center_code is null\r\n and med.revenue_center_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_discharge_disposition as(\r\n select \r\n 'discharge_disposition_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.discharge_disposition_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__discharge_disposition') }} discharge\r\n on med.discharge_disposition_code = discharge.discharge_disposition_code\r\n where med.claim_type = 'institutional'\r\n and discharge.discharge_disposition_code is null\r\n and med.discharge_disposition_code is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n, valid_admit_source as(\r\n select \r\n 'admit_source_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.admit_source_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__admit_source') }} adsource\r\n on med.admit_source_code = adsource.admit_source_code\r\n where med.claim_type = 'institutional'\r\n and adsource.admit_source_code is null\r\n and med.admit_source_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_admit_type as(\r\n select \r\n 'admit_type_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.admit_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__admit_type') }} adtype\r\n on med.admit_type_code = adtype.admit_type_code\r\n where med.claim_type = 'institutional'\r\n and adtype.admit_type_code is null\r\n and med.admit_type_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_ms_drg as(\r\n select \r\n 'ms_drg_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.ms_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__ms_drg') }} msdrg\r\n on med.ms_drg_code = msdrg.ms_drg_code\r\n where med.claim_type = 'institutional'\r\n and msdrg.ms_drg_code is null\r\n and med.ms_drg_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_apr_drg as(\r\n select \r\n 'apr_drg_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.apr_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__apr_drg') }} aprdrg\r\n on med.apr_drg_code = aprdrg.apr_drg_code\r\n and severity = '1'\r\n where med.claim_type = 'institutional'\r\n and aprdrg.apr_drg_code is null\r\n and med.apr_drg_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_present_on_admission as(\r\n select \r\n 'diagnosis_poa_1 invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_poa_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__present_on_admission') }} poa\r\n on med.diagnosis_poa_1 = poa.present_on_admit_code\r\n where med.claim_type = 'institutional'\r\n and poa.present_on_admit_code is null\r\n and med.diagnosis_poa_1 is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_procedure_code_type as(\r\n select \r\n 'procedure_code_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.procedure_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on med.procedure_code_type = codetype.code_type\r\n where claim_type = 'institutional'\r\n and codetype.code_type is null\r\n and med.procedure_code_type is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_place_of_service as(\r\n select \r\n 'place_of_service_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.place_of_service_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__place_of_service') }} pos\r\n on med.place_of_service_code = pos.place_of_service_code\r\n where claim_type = 'professional'\r\n and pos.place_of_service_code is null\r\n and med.place_of_service_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_diagnosis_code_type as(\r\n select \r\n 'diagnosis_code_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on med.diagnosis_code_type = codetype.code_type\r\n where codetype.code_type is null\r\n and med.diagnosis_code_type is not null\r\n group by\r\n claim_id\r\n)\r\n\r\n, valid_diagnosis_code as(\r\n select \r\n 'diagnosis_code_1 invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_code_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__icd_10_cm') }} icd\r\n on med.diagnosis_code_1 = icd.icd_10_cm\r\n where diagnosis_code_type = 'icd-10-cm'\r\n and icd.icd_10_cm is null\r\n and med.diagnosis_code_1 is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n\r\n, valid_claim_type as(\r\n select \r\n 'claim_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_type' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.claim_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__claim_type') }} claimtype\r\n on med.claim_type = claimtype.claim_type\r\n where claimtype.claim_type is null\r\n and med.claim_type is not null\r\n group by\r\n claim_id\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": [["medical_claim"], ["terminology__bill_type"], ["medical_claim"], ["terminology__revenue_center"], ["medical_claim"], ["terminology__discharge_disposition"], ["medical_claim"], ["terminology__admit_source"], ["medical_claim"], ["terminology__admit_type"], ["medical_claim"], ["terminology__ms_drg"], ["medical_claim"], ["terminology__apr_drg"], ["medical_claim"], ["terminology__present_on_admission"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__place_of_service"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__icd_10_cm"], ["medical_claim"], ["terminology__claim_type"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__discharge_disposition", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__admit_source", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__admit_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__apr_drg", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__present_on_admission", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__claim_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith valid_bill_type as(\n select\n 'bill_type_code invalid' as test_name\n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.bill_type_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.bill_type tob\n on med.bill_type_code = tob.bill_type_code\n where med.claim_type = 'institutional'\n and tob.bill_type_code is null\n and med.bill_type_code is not null\n group by\n claim_id\n\n)\n, valid_revenue_center as(\n select \n 'revenue_center_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.revenue_center_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.revenue_center rev\n on med.revenue_center_code = rev.revenue_center_code\n where med.claim_type = 'institutional'\n and rev.revenue_center_code is null\n and med.revenue_center_code is not null\n group by\n claim_id\n)\n, valid_discharge_disposition as(\n select \n 'discharge_disposition_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.discharge_disposition_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.discharge_disposition discharge\n on med.discharge_disposition_code = discharge.discharge_disposition_code\n where med.claim_type = 'institutional'\n and discharge.discharge_disposition_code is null\n and med.discharge_disposition_code is not null\n group by\n claim_id\n\n)\n, valid_admit_source as(\n select \n 'admit_source_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.admit_source_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.admit_source adsource\n on med.admit_source_code = adsource.admit_source_code\n where med.claim_type = 'institutional'\n and adsource.admit_source_code is null\n and med.admit_source_code is not null\n group by\n claim_id\n)\n, valid_admit_type as(\n select \n 'admit_type_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.admit_type_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.admit_type adtype\n on med.admit_type_code = adtype.admit_type_code\n where med.claim_type = 'institutional'\n and adtype.admit_type_code is null\n and med.admit_type_code is not null\n group by\n claim_id\n)\n, valid_ms_drg as(\n select \n 'ms_drg_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.ms_drg_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.ms_drg msdrg\n on med.ms_drg_code = msdrg.ms_drg_code\n where med.claim_type = 'institutional'\n and msdrg.ms_drg_code is null\n and med.ms_drg_code is not null\n group by\n claim_id\n)\n, valid_apr_drg as(\n select \n 'apr_drg_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.apr_drg_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.apr_drg aprdrg\n on med.apr_drg_code = aprdrg.apr_drg_code\n and severity = '1'\n where med.claim_type = 'institutional'\n and aprdrg.apr_drg_code is null\n and med.apr_drg_code is not null\n group by\n claim_id\n)\n, valid_present_on_admission as(\n select \n 'diagnosis_poa_1 invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.diagnosis_poa_1) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.present_on_admission poa\n on med.diagnosis_poa_1 = poa.present_on_admit_code\n where med.claim_type = 'institutional'\n and poa.present_on_admit_code is null\n and med.diagnosis_poa_1 is not null\n group by\n claim_id\n)\n, valid_procedure_code_type as(\n select \n 'procedure_code_type invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.procedure_code_type) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.code_type codetype\n on med.procedure_code_type = codetype.code_type\n where claim_type = 'institutional'\n and codetype.code_type is null\n and med.procedure_code_type is not null\n group by\n claim_id\n)\n, valid_place_of_service as(\n select \n 'place_of_service_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'professional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.place_of_service_code) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.place_of_service pos\n on med.place_of_service_code = pos.place_of_service_code\n where claim_type = 'professional'\n and pos.place_of_service_code is null\n and med.place_of_service_code is not null\n group by\n claim_id\n)\n, valid_diagnosis_code_type as(\n select \n 'diagnosis_code_type invalid' as test_name \n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.diagnosis_code_type) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.code_type codetype\n on med.diagnosis_code_type = codetype.code_type\n where codetype.code_type is null\n and med.diagnosis_code_type is not null\n group by\n claim_id\n)\n\n, valid_diagnosis_code as(\n select \n 'diagnosis_code_1 invalid' as test_name \n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.diagnosis_code_1) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.icd_10_cm icd\n on med.diagnosis_code_1 = icd.icd_10_cm\n where diagnosis_code_type = 'icd-10-cm'\n and icd.icd_10_cm is null\n and med.diagnosis_code_1 is not null\n group by\n claim_id\n\n)\n\n, valid_claim_type as(\n select \n 'claim_type invalid' as test_name \n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_type' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.claim_type) as filled_row_count\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.claim_type claimtype\n on med.claim_type = claimtype.claim_type\n where claimtype.claim_type is null\n and med.claim_type is not null\n group by\n claim_id\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": []}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_plausibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_plausibility"], "alias": "_int_medical_claim_plausibility", "checksum": {"name": "sha256", "checksum": "3c99fc08f1d20d18e95e6657219391704126aa7ea45cfdccc6f0e2f51b6cfdcd"}, "config": {"enabled": true, "alias": "_int_medical_claim_plausibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_plausibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.446522, "relation_name": "tuva.claims_preprocessing._int_medical_claim_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_start_date_after_claim_end_date as (\r\n select\r\n 'claim start date after claim end date' as test_name\r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_start_date > claim_end_date\r\n group by\r\n claim_id\r\n)\r\n, admission_date_after_discharge_date as (\r\n select\r\n 'admission date after discharge date' as test_name\r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'plausibility' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'institutional'\r\n and admission_date > discharge_date\r\n group by\r\n claim_id\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", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith claim_start_date_after_claim_end_date as (\n select\n 'claim start date after claim end date' as test_name\n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(*) as counts\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_start_date > claim_end_date\n group by\n claim_id\n)\n, admission_date_after_discharge_date as (\n select\n 'admission date after discharge date' as test_name\n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'plausibility' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(*) as counts\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type = 'institutional'\n and admission_date > discharge_date\n group by\n claim_id\n)\n\nselect * from claim_start_date_after_claim_end_date\nunion all\nselect * from admission_date_after_discharge_date", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_prof_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_prof_missing_values"], "alias": "_int_medical_claim_prof_missing_values", "checksum": {"name": "sha256", "checksum": "e5fe39288a98102636082dd5ecaef522b520a9f3775b510adcfbb3be6e3b31f6"}, "config": {"enabled": true, "alias": "_int_medical_claim_prof_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_prof_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4178348, "relation_name": "tuva.claims_preprocessing._int_medical_claim_prof_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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('medical_claim'), professional_missing_column_list, 'professional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith professional_missing as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'claim_line_number' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_line_number is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where patient_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where member_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_start_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_end_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'place_of_service_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where place_of_service_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'hcpcs_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where hcpcs_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'rendering_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where rendering_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where billing_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'paid_amount' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_amount is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_type is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n from tuva.claims_data_model.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' as column_checked\n from tuva.claims_data_model.medical_claim\n where data_source is null\n and claim_type = 'professional'\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom professional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__pharmacy_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__pharmacy_claim_duplicates"], "alias": "_int_pharmacy_claim_duplicates", "checksum": {"name": "sha256", "checksum": "977a8102918cf32a3639e2e053ff47fdf7eaae069a647df2729d34cf21505e7d"}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_duplicates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.498842, "relation_name": "tuva.claims_preprocessing._int_pharmacy_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'pharmacy_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate pharmacy claims' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by\r\n claim_id\r\n , claim_line_number\r\nhaving count(*) > 1", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n 'pharmacy_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'duplicate_values' as test_category\n , 'duplicate pharmacy claims' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__pharmacy_claim_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__pharmacy_claim_missing_values"], "alias": "_int_pharmacy_claim_missing_values", "checksum": {"name": "sha256", "checksum": "9a0b4ef0871caaab4da1c80844187c8095337c1042e09b3500bb47b7280fdbbe"}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.504005, "relation_name": "tuva.claims_preprocessing._int_pharmacy_claim_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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\n\r\n\r\nwith eligibility_missing as(\r\n\r\n {{ pharmacy_claim_missing_column_check(builtins.ref('pharmacy_claim'), pharmacy_claim_missing_column_list) }}\r\n\r\n)\r\n\r\n\r\nselect\r\n 'pharmacy_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_missing_column_check"], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith eligibility_missing as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where claim_id is null\n union all\n select\n claim_id\n , 'claim_line_number' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where claim_line_number is null\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where patient_id is null\n union all\n select\n claim_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where member_id is null\n union all\n select\n claim_id\n , 'prescribing_provider_npi' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where prescribing_provider_npi is null\n union all\n select\n claim_id\n , 'dispensing_provider_npi' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where dispensing_provider_npi is null\n union all\n select\n claim_id\n , 'dispensing_date' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where dispensing_date is null\n union all\n select\n claim_id\n , 'ndc_code' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where ndc_code is null\n union all\n select\n claim_id\n , 'quantity' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where quantity is null\n union all\n select\n claim_id\n , 'days_supply' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where days_supply is null\n union all\n select\n claim_id\n , 'refills' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where refills is null\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where paid_date is null\n union all\n select\n claim_id\n , 'paid_amount' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where paid_amount is null\n union all\n select\n claim_id\n , 'allowed_amount' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where allowed_amount is null\n union all\n select\n claim_id\n , 'data_source' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where data_source is null\n \n\n)\n\n\nselect\n 'pharmacy_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__professional_header_failures": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__professional_header_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "unique_id": "model.the_tuva_project.data_profiling__professional_header_failures", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_failures"], "alias": "_int_professional_header_failures", "checksum": {"name": "sha256", "checksum": "5c98a5c0d9918cd08c71123b4e2399c2e9013f42c41281b5cddcbde437403c34"}, "config": {"enabled": true, "alias": "_int_professional_header_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_failures", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.379228, "relation_name": "tuva.claims_preprocessing._int_professional_header_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith stage as(\r\n select distinct\r\n claim_id\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , claim_start_date\r\n , claim_end_date\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 from {{ ref('medical_claim') }} med\r\n where claim_type = 'professional'\r\n ) \r\n, claims_with_duplicates as (\r\nselect \r\n claim_id\r\n , 1 as invalid_header\r\nfrom stage\r\ngroup by claim_id\r\nhaving count(*) > 1\r\n)\r\n\r\nselect med.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\r\ninner join {{ ref('medical_claim') }} med\r\n on dupe.claim_id = med.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "compiled": true, "compiled_code": "\n\nwith stage as(\n select distinct\n claim_id\n , claim_type\n , patient_id\n , member_id\n , claim_start_date\n , claim_end_date\n , paid_date\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 , data_source\n from tuva.claims_data_model.medical_claim med\n where claim_type = 'professional'\n ) \n, claims_with_duplicates as (\nselect \n claim_id\n , 1 as invalid_header\nfrom stage\ngroup by claim_id\nhaving count(*) > 1\n)\n\nselect med.*, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run from claims_with_duplicates dupe\ninner join tuva.claims_data_model.medical_claim med\n on dupe.claim_id = med.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__professional_header_fail_details": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__professional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_fail_details"], "alias": "_int_professional_header_fail_details", "checksum": {"name": "sha256", "checksum": "dc413eb5f882b83d9d50e0d454924477c2f41ee13e2232246d6c7905acbb5a8f"}, "config": {"enabled": true, "alias": "_int_professional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_fail_details", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.3920052, "relation_name": "tuva.claims_preprocessing._int_professional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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 {{ header_duplicate_check(builtins.ref('data_profiling__professional_header_failures'), professional_header_column_list, 'professional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , 'header' as test_category\r\n , column_checked||' duplicated' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_header_duplicates\r\ngroup by \r\n claim_id\r\n , column_checked||' duplicated'", "language": "sql", "refs": [["data_profiling__professional_header_failures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__professional_header_failures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith professional_header_duplicates as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , 'place_of_service_code' as column_checked\n , count(distinct place_of_service_code) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct place_of_service_code) > 1\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n , count(distinct paid_date) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct paid_date) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct data_source) > 1\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , claim_id\n , 'header' as test_category\n , column_checked||' duplicated' as test_name\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom professional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_eligibility"], "alias": "_int_test_detail_stage_eligibility", "checksum": {"name": "sha256", "checksum": "3ea257ce7d15d19f894d261b9c90e28d2565c9c71a6f58480a9e9380df89f49c"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_eligibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4939506, "relation_name": "tuva.claims_preprocessing._int_test_detail_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_duplicates') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_missing_values') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_invalid_values') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_plausibility') }}", "language": "sql", "refs": [["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_missing_values"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_plausibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_duplicates\n union all\n select distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_missing_values\n union all\n select distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_invalid_values\n union all\n select distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_plausibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_medical_claim"], "alias": "_int_test_detail_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "be30aefba51ac1c3e53870f9210c97a3996ecc8c98247451522ab9d97322e7b3"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_medical_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4516802, "relation_name": "tuva.claims_preprocessing._int_test_detail_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n \r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__claim_type_unmapped') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_plausibility') }}", "language": "sql", "refs": [["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__claim_type_unmapped"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__medical_claim_plausibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n \nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_institutional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_professional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_inst_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_prof_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_invalid_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_claim_type_unmapped\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_claim_type_mapping_failures\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_plausibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_pharmacy_claim"], "alias": "_int_test_detail_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "c57e4871a6e66fe9e628ea04674fd01484c2cccd36cda5da1d951e2f342c1573"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_pharmacy_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5116184, "relation_name": "tuva.claims_preprocessing._int_test_detail_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__pharmacy_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__pharmacy_claim_missing_values') }}", "language": "sql", "refs": [["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_pharmacy_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_pharmacy_claim_missing_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_eligibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_eligibility"], "alias": "_int_test_result_stage_eligibility", "checksum": {"name": "sha256", "checksum": "d858540b5b651733e373f80b562f2df639042c582bd632f3381a3c8c87521f11"}, "config": {"enabled": true, "alias": "_int_test_result_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_eligibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4782903, "relation_name": "tuva.claims_preprocessing._int_test_result_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__eligibility_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'eligibility'\r\nand test_name not like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__eligibility_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'eligibility'\r\nand test_name like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"], ["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__eligibility_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_eligibility_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'eligibility'\nand test_name not like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_eligibility_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'eligibility'\nand test_name like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_medical_claim"], "alias": "_int_test_result_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "9e09b3dd40cb18b6bd1b99c6dff3ad670e4ea2d7752104d909bcc524b523e125"}, "config": {"enabled": true, "alias": "_int_test_result_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_medical_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.4362094, "relation_name": "tuva.claims_preprocessing._int_test_result_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__medical_claim_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'medical_claim'\r\nand test_name not like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__medical_claim_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'medical_claim'\r\nand test_name like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"], ["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_medical_claim_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'medical_claim'\nand test_name not like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_medical_claim_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'medical_claim'\nand test_name like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_pharmacy_claim"], "alias": "_int_test_result_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "a8f1577d9baa5e5aca5be82b3ce4fb2cecc5146c888c4fe10fae578753bf0f4c"}, "config": {"enabled": true, "alias": "_int_test_result_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_pharmacy_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1693946732.5084386, "relation_name": "tuva.claims_preprocessing._int_test_result_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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) as int) as count\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\n from {{ ref('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 , count(distinct foreign_key) as failures\r\n from {{ ref('data_profiling__test_detail') }}\r\n where source_table = '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 )\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 , claim.failures\r\n , elig.count as denominator\r\n , tuva_last_run\r\n from distinct_patient_per_category claim\r\n left join pharmacy_claim_denominator elig\r\n on claim.claim_type = elig.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 , claim.failures\r\n , elig.count\r\n , tuva_last_run", "language": "sql", "refs": [["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__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) as int) as count\n , cast('2023-09-05 20:45:28.914033+00:00' as TEXT ) as tuva_last_run\n from tuva.claims_data_model.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 , count(distinct foreign_key) as failures\n from tuva.claims_preprocessing.test_detail\n where source_table = 'pharmacy_claim'\n group by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n )\n\n select\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , claim.failures\n , elig.count as denominator\n , tuva_last_run\n from distinct_patient_per_category claim\n left join pharmacy_claim_denominator elig\n on claim.claim_type = elig.claim_type\n group by\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , claim.failures\n , elig.count\n , tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_input_layer_results": {"database": "tuva", "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": "2728cfd1aba4d232de5824afa376f94c6ec17a6760960ddb89577bb53a24b345"}, "config": {"enabled": true, "alias": "_dq_input_layer_results", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_results", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6685808, "relation_name": "tuva.claims_preprocessing._dq_input_layer_results", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__dq_input_layer_tests"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "tuva", "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": "dae1f976d3fd577553e88ed12cf87c51114514c03a4c753f3632dc909a664dc1"}, "config": {"enabled": true, "alias": "_dq_input_layer_tests", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_tests", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6722624, "relation_name": "tuva.claims_preprocessing._dq_input_layer_tests", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__claim_type"], ["service_category__stg_medical_claim"], ["terminology__place_of_service"], ["service_category__stg_medical_claim"], ["terminology__bill_type"], ["service_category__stg_medical_claim"], ["terminology__revenue_center"], ["service_category__stg_medical_claim"], ["terminology__hcpcs_level_2"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["service_category__stg_medical_claim"], ["terminology__apr_drg"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Multiple claim_type' as dq_problem\n, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "tuva", "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": "a7ccc6fbaedd38265491db76c0dd500b00bbde39f594c5c7c3454ce84cb1c705"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6762865, "relation_name": "tuva.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)))\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": [["service_category__combined_institutional"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_combined_institutional\ngroup by 1\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "tuva", "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": "229ae19e65242bacdae2da2b2c97bc6a8cf238748ec54a53d1aa0d14f77d2405"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6793168, "relation_name": "tuva.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)))\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": [["service_category__combined_professional"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_combined_professional\ngroup by 1,2\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__service_category_grouper": {"database": "tuva", "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": "d6182b55852b375209eb2e17343b2bdd7971fc95714b408177792ec0e1474ec5"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "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, "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, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "service_category_grouper", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5583336, "relation_name": "tuva.claims_preprocessing.service_category_grouper", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect 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\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft 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\nwhere a.claim_type = 'professional'\r\n\r\nunion all\r\n\r\nselect 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\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__combined_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nwhere a.claim_type = 'institutional'", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__combined_professional"], ["service_category__stg_medical_claim"], ["service_category__combined_institutional"]], "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": "\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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.claims_preprocessing._int_combined_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\nunion all\n\nselect 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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.claims_preprocessing._int_combined_institutional b\n on a.claim_id = b.claim_id\nwhere a.claim_type = 'institutional'", "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"database": "tuva", "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": "afe752a80c19139109f0199a02b6bbca127bbea0f5e96ed846c6087995533828"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5685673, "relation_name": "tuva.claims_preprocessing._int_acute_inpatient_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 tuva.terminology.ms_drg msdrg\n on mc.ms_drg_code = msdrg.ms_drg_code\nleft join tuva.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, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "tuva", "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": "27e92517869ec9d26468e1dd8b181b15f8a350babd66a8bfd73c8b82afe49688"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5720797, "relation_name": "tuva.claims_preprocessing._int_acute_inpatient_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct\n claim_id\n, claim_line_number\n, 'Acute Inpatient' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "tuva", "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": "44f209883bcf412c4870a26c12a607c1b3e4090a24206ab65809c5913967531a"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulance_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5720797, "relation_name": "tuva.claims_preprocessing._int_ambulance_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Ambulance' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "tuva", "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": "4e5e07316310a0419c13790829deb8ee659e979827caded81cd42a9196634847"}, "config": {"enabled": true, "alias": "_int_ambulatory_surgery_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulatory_surgery_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5795777, "relation_name": "tuva.claims_preprocessing._int_ambulatory_surgery_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Ambulatory Surgery' as service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__combined_institutional": {"database": "tuva", "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": "56860dbf5ecaf891a951089a18a3aa21c48013c9a621964128710046dc3c997a"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5583336, "relation_name": "tuva.claims_preprocessing._int_combined_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\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') }}", "language": "sql", "refs": [["service_category__acute_inpatient_institutional"], ["service_category__dialysis_institutional"], ["service_category__emergency_department_institutional"], ["service_category__home_health_institutional"], ["service_category__hospice_institutional"], ["service_category__lab_institutional"], ["service_category__outpatient_hospital_or_clinic_institutional"], ["service_category__outpatient_psychiatric_institutional"], ["service_category__skilled_nursing_institutional"], ["service_category__urgent_care_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["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\nselect *\nfrom tuva.claims_preprocessing._int_acute_inpatient_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_dialysis_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_emergency_department_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_home_health_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_hospice_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_lab_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_psychiatric_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_skilled_nursing_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_urgent_care_institutional", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__combined_professional": {"database": "tuva", "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": "b019934726b13915965e03d72e9d60b6adf431f634855b85ba2942543af213d5"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5583336, "relation_name": "tuva.claims_preprocessing._int_combined_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__ambulance_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__dme_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') }}", "language": "sql", "refs": [["service_category__acute_inpatient_professional"], ["service_category__ambulance_professional"], ["service_category__ambulatory_surgery_professional"], ["service_category__dialysis_professional"], ["service_category__dme_professional"], ["service_category__emergency_department_professional"], ["service_category__home_health_professional"], ["service_category__hospice_professional"], ["service_category__inpatient_psychiatric_professional"], ["service_category__inpatient_rehab_professional"], ["service_category__lab_professional"], ["service_category__office_visit_professional"], ["service_category__outpatient_hospital_or_clinic_professional"], ["service_category__outpatient_psychiatric_professional"], ["service_category__outpatient_rehab_professional"], ["service_category__skilled_nursing_professional"], ["service_category__urgent_care_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["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_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"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "compiled": true, "compiled_code": "\n\nselect *\nfrom tuva.claims_preprocessing._int_acute_inpatient_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_ambulance_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_ambulatory_surgery_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_dialysis_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_dme_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_emergency_department_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_home_health_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_hospice_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_inpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_inpatient_rehab_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_lab_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_office_visit_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_hospital_or_clinic_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_rehab_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_skilled_nursing_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_urgent_care_professional", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dialysis_institutional": {"database": "tuva", "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": "20e78d709c0ed0460182d80c44a6e17e89af5baa64f42d3630b8ffd609f605cd"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5795777, "relation_name": "tuva.claims_preprocessing._int_dialysis_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Dialysis' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "tuva", "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": "d44b35e28d2318bd5ad888394e5967f4d8641d11299f63ab21ab68393c97d1a7"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5795777, "relation_name": "tuva.claims_preprocessing._int_dialysis_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Dialysis' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dme_professional": {"database": "tuva", "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": "e7afd6e430fa8cdd893ac98646228f7bd33ccc6f64a1c565674ec361dd95a9ef"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dme_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.58871, "relation_name": "tuva.claims_preprocessing._int_dme_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Durable Medical Equipment' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "tuva", "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": "0d97b57099e158e3cca511f4394654d3706582ba6f3a60d423b7fc5de1caa5cb"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.58871, "relation_name": "tuva.claims_preprocessing._int_emergency_department_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n 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') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code in ('0450','0451','0452','0459','0981')\r\n and left(bill_type_code,2) in ('13','71','73')\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": [["service_category__stg_medical_claim"]], "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_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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Emergency Department' as service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code in ('0450','0451','0452','0459','0981')\n and left(bill_type_code,2) in ('13','71','73')\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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "tuva", "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": "6dd74ae07d39e1bc9cd076cc3db91c05beb1efc03921bf7a929eeeae16cfeb6a"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.58871, "relation_name": "tuva.claims_preprocessing._int_emergency_department_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Emergency Department' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "tuva", "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": "efb90e774ffe4cb653057354fd144a139dad955f7cab60601388b4d763137ace"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.597724, "relation_name": "tuva.claims_preprocessing._int_home_health_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Home Health' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__home_health_professional": {"database": "tuva", "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": "db35d1592f7e4f81e6f32a949c491323163e8bd032a1bbb763545b7e6ca5e2c3"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.5992117, "relation_name": "tuva.claims_preprocessing._int_home_health_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Home Health' as service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "tuva", "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": "3bc8831be11a812e16eae225c7830a2740d9b81d9f50ccec81649b4daa7d828d"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.603232, "relation_name": "tuva.claims_preprocessing._int_hospice_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Hospice' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__hospice_professional": {"database": "tuva", "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": "9a5689f5227edac24e3411d7474e9650b4976702dd244f9e161d806016b8b556"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6054635, "relation_name": "tuva.claims_preprocessing._int_hospice_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Hospice' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "tuva", "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": "b3b9c8cc407ad449f552a3c4253f23c8c3be51564ecb5fc14206799fabf4ad9d"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_psychiatric_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.608484, "relation_name": "tuva.claims_preprocessing._int_inpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Psychiatric' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "tuva", "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": "202e394bb6ed3de077f9961f8b7eac1a0019b4cbd89cbe8549e82236c927ed3f"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_rehab_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.614269, "relation_name": "tuva.claims_preprocessing._int_inpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Rehabilitation' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__lab_institutional": {"database": "tuva", "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": "ccc73a53515e6e1353b99078dd083379f868eaaea51ae614401b6151c6f4d7e0"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6198483, "relation_name": "tuva.claims_preprocessing._int_lab_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Lab' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__lab_professional": {"database": "tuva", "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": "c0cb05661eb5c335447327f638b0317dad985f25b2485e01275746138b448fbf"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6233838, "relation_name": "tuva.claims_preprocessing._int_lab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Lab' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "tuva", "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": "44ababd289d8045ee2c9140015196a46dfc087cd6173deb0ce511fd30a04b59c"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_office_visit_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.626776, "relation_name": "tuva.claims_preprocessing._int_office_visit_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Office Visit' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "tuva", "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": "32ff91af7dcb9e139efd403486bed63509b968fc152a588184a1482bdf2b2321"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6317573, "relation_name": "tuva.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)))\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": [["service_category__stg_medical_claim"], ["service_category__emergency_department_institutional"], ["service_category__urgent_care_institutional"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nleft join tuva.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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "tuva", "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": "1c399c15ab5818875a0316a7f093aa2cc445f4cd8dca48bbdedd8387779ef127"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6357431, "relation_name": "tuva.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)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "tuva", "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": "cc4578150352a181c4b5118b91993beb634abe3b8bb5631bdba9e8cb0f03361f"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6397662, "relation_name": "tuva.claims_preprocessing._int_outpatient_psychiatric_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Outpatient Psychiatric' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "tuva", "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": "e1fa4188a9df6040ced7494410a4e588b9e2d6f4c54d56564324624cdc66f375"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6433349, "relation_name": "tuva.claims_preprocessing._int_outpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Psychiatric' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "tuva", "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": "a82703bf4e7373d72097ea876af395212a4547433e54a6b86a754ea79907ac0a"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_rehab_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6475923, "relation_name": "tuva.claims_preprocessing._int_outpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Rehabilitation' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "tuva", "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": "95189065009a39d41e95fd40c6cf9fbbd50087c6ce48819c993ba85cf7660a62"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.653599, "relation_name": "tuva.claims_preprocessing._int_skilled_nursing_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Skilled Nursing' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "tuva", "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": "c43c5519de8e58ff36fdad21e76aeceef9c48140e4b55c464db4369defb269cd"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.657597, "relation_name": "tuva.claims_preprocessing._int_skilled_nursing_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Skilled Nursing' as service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "tuva", "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": "06c0e5db157aa4fd77b6ff06f6964994e57d1442c8aaffdd4af00209e72ada7c"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_institutional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6610947, "relation_name": "tuva.claims_preprocessing._int_urgent_care_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n 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') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code = '0456'\r\n and left(bill_type_code,2) in ('13','71','73')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "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_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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Urgent Care' as service_category_2\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code = '0456'\n and left(bill_type_code,2) in ('13','71','73')", "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "tuva", "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": "997ffe7833fd3ceb34e168fb79278b6b99eb8e0526588cf1aa7d2c8fc212ff0b"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_professional", "materialized": "table", "tags": "service_category_grouper", "enabled": true, "bind": false}, "created_at": 1693946732.6640844, "relation_name": "tuva.claims_preprocessing._int_urgent_care_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Urgent Care' as service_category_2\n, '2023-09-05 20:45:28.914033+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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "2965d28559d54346b2cd74e9da52a2f032c2cc203edaf96744344924335b1235"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1693946732.666078, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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'2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"database": "tuva", "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": "52ea94e810313bf1dd20b03a2fe8a33de8a2e443abdf5bf4a97c52490191ca6c"}, "config": {"enabled": true, "alias": "patient_risk_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.6844172, "relation_name": "tuva.cms_hcc.patient_risk_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , enrollment_status\r\n || ' / '\r\n || gender\r\n || ' / '\r\n || age_group\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 || ' / '\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 , 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 , enrollment_status_default\r\n , medicaid_dual_status_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 , 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 , 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 , 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 , 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 , 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.institutional_status_default\r\n , unioned.description as risk_factor_description\r\n , unioned.coefficient\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\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(institutional_status_default as boolean) as institutional_status_default\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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , institutional_status_default\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": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_demographic_factors"], ["cms_hcc__int_disease_factors"], ["cms_hcc__int_enrollment_interaction_factors"], ["cms_hcc__int_disabled_interaction_factors"], ["cms_hcc__int_disease_interaction_factors"], ["cms_hcc__int_hcc_count_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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 , enrollment_status\n || ' / '\n || gender\n || ' / '\n || age_group\n || ' / '\n || case\n when medicaid_status = 'Yes' then 'Medicaid'\n else 'Non-Medicaid'\n end\n || ' / '\n || dual_status\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 , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, demographic_defaults as (\n\n select\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n from tuva.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 , model_version\n , payment_year\n from tuva.cms_hcc._int_disease_factors\n\n)\n\n, enrollment_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.cms_hcc._int_enrollment_interaction_factors\n\n)\n\n, disabled_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.cms_hcc._int_disabled_interaction_factors\n\n)\n\n, disease_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.cms_hcc._int_disease_interaction_factors\n\n)\n\n, hcc_counts as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.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.institutional_status_default\n , unioned.description as risk_factor_description\n , unioned.coefficient\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\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(institutional_status_default as boolean) as institutional_status_default\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 , cast('2023-09-05 16:46:37' as TIMESTAMP) as date_calculated\n from add_defaults\n\n)\n\nselect\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , risk_factor_description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "tuva", "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": "1d039532b5f5483d49292e60380f757cbd845d53f53d055625439f754871402a"}, "config": {"enabled": true, "alias": "patient_risk_scores", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model calculates the CMS HCC raw 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, "quote": null, "tags": []}, "raw_risk_score": {"name": "raw_risk_score", "description": "The sum of all patient risk factors.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_risk_score": {"name": "normalized_risk_score", "description": "The raw 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, "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 years rate announcement from CMS.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_scores", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.6889262, "relation_name": "tuva.cms_hcc.patient_risk_scores", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , round(cast(sum(coefficient) as {{ dbt.type_numeric() }}),3) 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, normalized as (\r\n\r\n select\r\n raw_score.patient_id\r\n , raw_score.risk_score as raw_risk_score\r\n , round(cast(raw_score.risk_score / seed_adjustment_rates.normalization_factor as {{ dbt.type_numeric() }}),3) as normalized_risk_score\r\n , raw_score.model_version\r\n , raw_score.payment_year\r\n from raw_score\r\n left join seed_adjustment_rates\r\n on raw_score.payment_year = seed_adjustment_rates.payment_year\r\n and raw_score.model_version = seed_adjustment_rates.model_version\r\n\r\n)\r\n\r\n, payment as (\r\n\r\n select\r\n normalized.patient_id\r\n , normalized.raw_risk_score\r\n , normalized.normalized_risk_score\r\n , round(cast(normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as {{ dbt.type_numeric() }}),3) as payment_risk_score\r\n , normalized.model_version\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 and normalized.model_version = seed_adjustment_rates.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 , round(cast(raw_risk_score as {{ dbt.type_numeric() }}),3) as raw_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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from payment\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , raw_risk_score\r\n , normalized_risk_score\r\n , payment_risk_score\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": [["cms_hcc__adjustment_rates"], ["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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 tuva.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 tuva.cms_hcc.patient_risk_factors\n\n)\n\n, raw_score as (\n\n select\n patient_id\n , round(cast(sum(coefficient) as numeric(28,6)),3) 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, normalized as (\n\n select\n raw_score.patient_id\n , raw_score.risk_score as raw_risk_score\n , round(cast(raw_score.risk_score / seed_adjustment_rates.normalization_factor as numeric(28,6)),3) as normalized_risk_score\n , raw_score.model_version\n , raw_score.payment_year\n from raw_score\n left join seed_adjustment_rates\n on raw_score.payment_year = seed_adjustment_rates.payment_year\n and raw_score.model_version = seed_adjustment_rates.model_version\n\n)\n\n, payment as (\n\n select\n normalized.patient_id\n , normalized.raw_risk_score\n , normalized.normalized_risk_score\n , round(cast(normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as numeric(28,6)),3) as payment_risk_score\n , normalized.model_version\n , normalized.payment_year\n from normalized\n left join seed_adjustment_rates\n on normalized.payment_year = seed_adjustment_rates.payment_year\n and normalized.model_version = seed_adjustment_rates.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , round(cast(raw_risk_score as numeric(28,6)),3) as raw_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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-05 16:46:38' as TIMESTAMP) as date_calculated\n from payment\n\n)\n\nselect\n patient_id\n , raw_risk_score\n , normalized_risk_score\n , payment_risk_score\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "tuva", "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": "256636e9e87a1b0f86e10beb0405f9802b69e53a9beba3f141f972f934985d9d"}, "config": {"enabled": true, "alias": "_int_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_demographic_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.697434, "relation_name": "tuva.cms_hcc._int_demographic_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , institutional_status_default\r\n , model_version\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 and model_version = '{{ model_version_compiled }}'\r\n\r\n)\r\n\r\n, 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.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\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\r\n)\r\n\r\n, 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.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\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\r\n)\r\n\r\n/*\r\n The CMS-HCC model does not have factors for ESRD or null medicare status\r\n for these edge-cases, we default to 'Aged' and dual_status is Non or Partial.\r\n*/\r\n, other_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.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\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 where seed_demographic_factors.orec = 'Aged'\r\n and (members.orec = 'ESRD'\r\n or members.orec is null)\r\n and (seed_demographic_factors.dual_status in ('Non', 'Partial')\r\n or seed_demographic_factors.dual_status is null)\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from new_enrollees\r\n union all\r\n select * from continuining_enrollees\r\n union all\r\n select * from other_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(institutional_status_default as boolean) as institutional_status_default\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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , institutional_status_default\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": [["cms_hcc__int_members"], ["cms_hcc__demographic_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , institutional_status_default\n , model_version\n , payment_year\n from tuva.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 tuva.cms_hcc._value_set_demographic_factors\n where plan_segment is null /* data not available */\n and model_version = 'CMS-HCC-V24'\n\n)\n\n, 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.institutional_status_default\n , members.model_version\n , members.payment_year\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\n)\n\n, 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.institutional_status_default\n , members.model_version\n , members.payment_year\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\n)\n\n/*\n The CMS-HCC model does not have factors for ESRD or null medicare status\n for these edge-cases, we default to 'Aged' and dual_status is Non or Partial.\n*/\n, other_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.institutional_status_default\n , members.model_version\n , members.payment_year\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 where seed_demographic_factors.orec = 'Aged'\n and (members.orec = 'ESRD'\n or members.orec is null)\n and (seed_demographic_factors.dual_status in ('Non', 'Partial')\n or seed_demographic_factors.dual_status is null)\n\n)\n\n, unioned as (\n\n select * from new_enrollees\n union all\n select * from continuining_enrollees\n union all\n select * from other_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(institutional_status_default as boolean) as institutional_status_default\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 , cast('2023-09-05 16:46:17' as TIMESTAMP) as date_calculated\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 , institutional_status_default\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "tuva", "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": "3161edd55b2c1a490158435e962f2732f8e8fdf9eff3e42cc72de36b2676fa0b"}, "config": {"enabled": true, "alias": "_int_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disabled_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.7030988, "relation_name": "tuva.cms_hcc._int_disabled_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 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 , 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 where model_version = '{{ model_version_compiled }}'\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\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.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\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\nfrom interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , 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": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disabled_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , institutional_status\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , enrollment_status\n , institutional_status\n , short_name\n , description\n , hcc_code\n , coefficient\n from tuva.cms_hcc._value_set_disabled_interaction_factors\n where model_version = 'CMS-HCC-V24'\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\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.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\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-05 16:46:36' as TIMESTAMP) as date_calculated\nfrom interactions\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "tuva", "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": "78a840f230bdc382519836e94e0b2ce75ce4d3e36e4454ec81faa46e3b3e4953"}, "config": {"enabled": true, "alias": "_int_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.7081437, "relation_name": "tuva.cms_hcc._int_disease_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , institutional_status_default\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 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 , 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 where model_version = '{{ model_version_compiled }}'\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.enrollment_status_default\r\n , demographics.medicaid_dual_status_default\r\n , demographics.institutional_status_default\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\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.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\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_disease_factors as (\n\n select\n model_version\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , hcc_code\n , description\n , coefficient\n from tuva.cms_hcc._value_set_disease_factors\n where model_version = 'CMS-HCC-V24'\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.enrollment_status_default\n , demographics.medicaid_dual_status_default\n , demographics.institutional_status_default\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\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.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\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-05 16:46:36' as TIMESTAMP) as date_calculated\n from disease_factors\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "tuva", "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": "718708e0f1411feba43711f034c219e8fe846143dd1a02eacb40a6fa73e608d9"}, "config": {"enabled": true, "alias": "_int_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.7128193, "relation_name": "tuva.cms_hcc._int_disease_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , institutional_status_default\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 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 , 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 where model_version = '{{ model_version_compiled }}'\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.enrollment_status_default\r\n , demographics.medicaid_dual_status_default\r\n , demographics.institutional_status_default\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\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.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\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.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)\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\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 tuva.cms_hcc._value_set_disease_interaction_factors\n where model_version = 'CMS-HCC-V24'\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.enrollment_status_default\n , demographics.medicaid_dual_status_default\n , demographics.institutional_status_default\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\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.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\n)\n\n, disease_interactions as (\n\n select\n demographics_with_interactions.patient_id\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)\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-05 16:46:36' as TIMESTAMP) as date_calculated\n from disease_interactions\n\n)\n\nselect\n patient_id\n , hcc_code_1\n , hcc_code_2\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "tuva", "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": "658b61d3229d9500498b1339abeffd5b20fa430c3d9f3bbaaec576882ce9c485"}, "config": {"enabled": true, "alias": "_int_eligible_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_eligible_conditions", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.716806, "relation_name": "tuva.cms_hcc._int_eligible_conditions", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 and collection year variables.\r\n - The hcc_model_version and payment_year vars have been set here\r\n so they get compiled.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\r\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\r\n{% set collection_year = payment_year_compiled - 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_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_compiled }}\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_compiled }}\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('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\r\n , cast('{{ payment_year_compiled }}' as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from eligible_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_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": [["cms_hcc__stg_medical_claim"], ["cms_hcc__stg_core__condition"], ["cms_hcc__cpt_hcpcs"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.cms_hcc__stg_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 and collection year variables.\n - The hcc_model_version and payment_year vars have been set here\n so they get compiled.\n - The collection year is one year prior to the payment year.\n*/\n\nwith __dbt__cte__cms_hcc__stg_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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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_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 tuva.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) = 2022\n and cpt_hcpcs_list.payment_year = 2023\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) = 2022\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) = 2022\n and cpt_hcpcs_list.payment_year = 2023\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('CMS-HCC-V24' as TEXT) as model_version\n , cast('2023' as integer) as payment_year\n , cast('2023-09-05 16:46:30' as TIMESTAMP) as date_calculated\n from eligible_conditions\n\n)\n\nselect\n patient_id\n , condition_code\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_medical_claim", "sql": " __dbt__cte__cms_hcc__stg_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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}]}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "tuva", "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": "5a60e406275e7558a659fd9df4208d6596a603496cfcf8b4d16f84f85136af3f"}, "config": {"enabled": true, "alias": "_int_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_enrollment_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.7213426, "relation_name": "tuva.cms_hcc._int_enrollment_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , institutional_status_default\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 , gender\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__enrollment_interaction_factors') }}\r\n where model_version = '{{ model_version_compiled }}'\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.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 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.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 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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , 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": [["cms_hcc__int_demographic_factors"], ["cms_hcc__enrollment_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , gender\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , description\n , coefficient\n from tuva.cms_hcc._value_set_enrollment_interaction_factors\n where model_version = 'CMS-HCC-V24'\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.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 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.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 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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-05 16:46:19' as TIMESTAMP) as date_calculated\n from unioned\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "tuva", "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": "6c13c8bf450c01501197470bd61de44bf61e7a8e713698a9eb2bd144d0497c93"}, "config": {"enabled": true, "alias": "_int_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_count_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.724453, "relation_name": "tuva.cms_hcc._int_hcc_count_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , 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 where model_version = '{{ model_version_compiled }}'\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 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 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.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\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__payment_hcc_count_factors"], ["cms_hcc__int_hcc_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 tuva.cms_hcc._int_demographic_factors\n\n)\n\n, seed_payment_hcc_count_factors as (\n\n select\n model_version\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , payment_hcc_count\n , description\n , coefficient\n from tuva.cms_hcc._value_set_payment_hcc_count_factors\n where model_version = 'CMS-HCC-V24'\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.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 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.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\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-05 16:46:36' as TIMESTAMP) as date_calculated\n from hcc_counts\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "tuva", "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": "db16fe4ff61d27cde25f8388baa7f2a8ee7cae8da01aa74d5a3c40fa16df92b9"}, "config": {"enabled": true, "alias": "_int_hcc_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_hierarchy", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.730447, "relation_name": "tuva.cms_hcc._int_hcc_hierarchy", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\n Staging HCCs that will be used in disease factor calculations.\r\n Final output 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 The hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 where model_version = '{{ model_version_compiled }}'\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 left join seed_hcc_hierarchy as hcc_exclusions\r\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\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\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 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 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 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 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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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": [["cms_hcc__int_hcc_mapping"], ["cms_hcc__disease_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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 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 The hcc_model_version var has been set here so it gets compiled.\n*/\n\nwith hcc_mapping as (\n\n select distinct\n patient_id\n , hcc_code\n , model_version\n , payment_year\n from tuva.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 tuva.cms_hcc._value_set_disease_hierarchy\n where model_version = 'CMS-HCC-V24'\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 left join seed_hcc_hierarchy as hcc_exclusions\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\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\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 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 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 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 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 , cast('2023-09-05 16:46:35' as TIMESTAMP) as date_calculated\n from unioned\n\n)\n\nselect\n patient_id\n , model_version\n , payment_year\n , hcc_code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "tuva", "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": "1c99c0a9ba5961952dce78fe29c00ad7c73e7fa43f3a8700db438af6f35895f4"}, "config": {"enabled": true, "alias": "_int_hcc_mapping", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_mapping", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.7344337, "relation_name": "tuva.cms_hcc._int_hcc_mapping", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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\r\n\r\nJinja is used to set payment and collection year variables.\r\n - The hcc_model_version and payment_year vars have been set here\r\n so they get compiled.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\r\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , condition_code\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_eligible_conditions') }}\r\n\r\n)\r\n\r\n/*\r\n Using jinja to choose the correct column based on hcc_model_version var.\r\n*/\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n diagnosis_code\r\n , cms_hcc_v24 as hcc_code /* will be replaced with logic to use correct col based on version var */\r\n from {{ ref('cms_hcc__icd_10_cm_mappings') }}\r\n where payment_year = {{ payment_year_compiled }}\r\n and cms_hcc_v24_flag = 'Yes' /* will be replaced with logic to use correct col based on version var */\r\n\r\n)\r\n\r\n, mapped as (\r\n\r\n select distinct\r\n conditions.patient_id\r\n , conditions.condition_code\r\n , conditions.model_version\r\n , conditions.payment_year\r\n , seed_hcc_mapping.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\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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from mapped\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": [["cms_hcc__int_eligible_conditions"], ["cms_hcc__icd_10_cm_mappings"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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\n\nJinja is used to set payment and collection year variables.\n - The hcc_model_version and payment_year vars have been set here\n so they get compiled.\n - The collection year is one year prior to the payment year.\n*/\n\nwith conditions as (\n\n select\n patient_id\n , condition_code\n , model_version\n , payment_year\n from tuva.cms_hcc._int_eligible_conditions\n\n)\n\n/*\n Using jinja to choose the correct column based on hcc_model_version var.\n*/\n, seed_hcc_mapping as (\n\n select\n diagnosis_code\n , cms_hcc_v24 as hcc_code /* will be replaced with logic to use correct col based on version var */\n from tuva.cms_hcc._value_set_icd_10_cm_mappings\n where payment_year = 2023\n and cms_hcc_v24_flag = 'Yes' /* will be replaced with logic to use correct col based on version var */\n\n)\n\n, mapped as (\n\n select distinct\n conditions.patient_id\n , conditions.condition_code\n , conditions.model_version\n , conditions.payment_year\n , seed_hcc_mapping.hcc_code\n from conditions\n inner join seed_hcc_mapping\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\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 , cast('2023-09-05 16:46:33' as TIMESTAMP) as date_calculated\n from mapped\n\n)\n\nselect\n patient_id\n , condition_code\n , hcc_code\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_members": {"database": "tuva", "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": "a63fd275e8fd84ba339510b30e0fdfe659ea424ec3aa611b69060ac7163fb108"}, "config": {"enabled": true, "alias": "_int_members", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_members.sql", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_members", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946732.7409332, "relation_name": "tuva.cms_hcc._int_members", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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.\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 and collection year variables.\r\n - The hcc_model_version and payment_year vars have been set here\r\n so they get 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 model_version_compiled = var('cms_hcc_model_version') -%}\r\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\r\n{% set payment_year_age_date = payment_year_compiled ~ '-02-01' -%}\r\n{% set collection_year = payment_year_compiled - 1 -%}\r\n{% set collection_year_start = collection_year ~ '-01-01' -%}\r\n\r\nwith stg_eligibility as (\r\n\r\n select\r\n patient_id\r\n , gender\r\n , birth_date\r\n , floor({{ datediff('birth_date', \"'\"~payment_year_age_date~\"'\", 'hour') }} / 8766.0) as payment_year_age\r\n , enrollment_start_date\r\n , enrollment_end_date\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_eligibility') }}\r\n\r\n)\r\n\r\n, calculate_prior_coverage as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_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 , enrollment_end_date\r\n , case\r\n when enrollment_start_date < '{{ collection_year_start }}'\r\n then {{ datediff(\"'\"~collection_year_start~\"'\", 'enrollment_end_date', 'month') }} +1 /* include starting month */\r\n else {{ datediff('enrollment_start_date', 'enrollment_end_date', 'month') }} +1 /* include starting month */\r\n end as coverage_months\r\n from stg_eligibility\r\n where\r\n /* coverage dates must fall within the collection year */\r\n (extract(year from enrollment_start_date) = {{ collection_year }}\r\n or extract(year from enrollment_start_date) = {{ collection_year }})\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 distinct\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_eligibility.gender\r\n , stg_eligibility.payment_year_age\r\n , stg_eligibility.dual_status_code\r\n , stg_eligibility.medicare_status_code\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 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 , 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_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 /*, null as plan_segment --data not available */\r\n , cast(case\r\n when gender = 'female' then 'Female'\r\n when gender = 'male' then 'Male'\r\n else null\r\n end as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(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 {{ dbt.type_string() }}) as medicaid_status\r\n , cast(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 {{ dbt.type_string() }}) as dual_status\r\n /*\r\n Medicare status is being used as an analog for OREC to calculate\r\n demographic risk factors, this will be replaced when OREC is added to\r\n the data model.\r\n */\r\n , cast(case\r\n when medicare_status_code in ('10','11') then 'Aged'\r\n when medicare_status_code in ('20','21') then 'Disabled'\r\n when medicare_status_code in ('31') then 'ESRD'\r\n end as {{ dbt.type_string() }}) as orec\r\n /*\r\n Defaulting everyone to non-institutional until logic is added\r\n */\r\n , cast('No'as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(case\r\n when dual_status_code is null then True\r\n else FALSE\r\n end as boolean) as medicaid_dual_status_default\r\n , cast(True as boolean) as institutional_status_default\r\n , cast('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\r\n , cast('{{ payment_year_compiled }}' as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from add_age_group\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 , institutional_status_default\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": [["cms_hcc__stg_eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.cms_hcc__stg_eligibility"]}, "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.\n 3) Add age groups based on the payment year.\n 4) Determine other statuses.\n\nJinja is used to set payment and collection year variables.\n - The hcc_model_version and payment_year vars have been set here\n so they get 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_eligibility as (\n\nselect\n patient_id\n , gender\n , birth_date\n , enrollment_start_date\n , enrollment_end_date\n , dual_status_code\n , medicare_status_code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n),stg_eligibility as (\n\n select\n patient_id\n , gender\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n '2023-02-01'\n ) / 8766.0) as payment_year_age\n , enrollment_start_date\n , enrollment_end_date\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_eligibility\n\n)\n\n, calculate_prior_coverage as (\n\n select\n patient_id\n , enrollment_start_date\n , case\n when enrollment_start_date < '2022-01-01'\n then '2022-01-01'\n else enrollment_start_date\n end as proxy_enrollment_start_date\n , enrollment_end_date\n , case\n when enrollment_start_date < '2022-01-01'\n then datediff(\n month,\n '2022-01-01',\n enrollment_end_date\n ) +1 /* include starting month */\n else datediff(\n month,\n enrollment_start_date,\n enrollment_end_date\n ) +1 /* include starting month */\n end as coverage_months\n from stg_eligibility\n where\n /* coverage dates must fall within the collection year */\n (extract(year from enrollment_start_date) = 2022\n or extract(year from enrollment_start_date) = 2022)\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 distinct\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_eligibility.gender\n , stg_eligibility.payment_year_age\n , stg_eligibility.dual_status_code\n , stg_eligibility.medicare_status_code\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 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 , 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_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 /*, null as plan_segment --data not available */\n , cast(case\n when gender = 'female' then 'Female'\n when gender = 'male' then 'Male'\n else null\n end as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(case\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\n else 'No'\n end as TEXT) as medicaid_status\n , cast(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 TEXT) as dual_status\n /*\n Medicare status is being used as an analog for OREC to calculate\n demographic risk factors, this will be replaced when OREC is added to\n the data model.\n */\n , cast(case\n when medicare_status_code in ('10','11') then 'Aged'\n when medicare_status_code in ('20','21') then 'Disabled'\n when medicare_status_code in ('31') then 'ESRD'\n end as TEXT) as orec\n /*\n Defaulting everyone to non-institutional until logic is added\n */\n , cast('No'as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(case\n when dual_status_code is null then True\n else FALSE\n end as boolean) as medicaid_dual_status_default\n , cast(True as boolean) as institutional_status_default\n , cast('CMS-HCC-V24' as TEXT) as model_version\n , cast('2023' as integer) as payment_year\n , cast('2023-09-05 16:46:09' as TIMESTAMP) as date_calculated\n from add_age_group\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 , institutional_status_default\n , model_version\n , payment_year\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_eligibility", "sql": " __dbt__cte__cms_hcc__stg_eligibility as (\n\nselect\n patient_id\n , gender\n , birth_date\n , enrollment_start_date\n , enrollment_end_date\n , dual_status_code\n , medicare_status_code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}]}, "model.the_tuva_project.cms_hcc__stg_core__condition": {"database": "tuva", "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": "82f6033156f73aa794aea254ea8e4145a1a229fef71da02b57c85be19b9b0411"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1693946732.7449222, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\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": [["core__condition"]], "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 , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_eligibility": {"database": "tuva", "schema": "cms_hcc", "name": "cms_hcc__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_eligibility.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_eligibility.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_eligibility", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "244f02f21fe9131012c12cacac50cd1ee122a46d677ba2554ea770835c91441c"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1693946732.7505438, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , gender\r\n , birth_date\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , dual_status_code\r\n , medicare_status_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_eligibility.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , gender\n , birth_date\n , enrollment_start_date\n , enrollment_end_date\n , dual_status_code\n , medicare_status_code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_medical_claim": {"database": "tuva", "schema": "cms_hcc", "name": "cms_hcc__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_medical_claim.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_medical_claim", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "9110c166e02c6867fcee744f43c6a30b9588722b327b72dcced1c49c9a12dec9"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging medical claims from the input layer.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1693946732.7540736, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__condition": {"database": "tuva", "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": "6bf20ce96592d16fd9ab798870231dc2cb5fd32632e677db4eccf028738d1a4f"}, "config": {"enabled": true, "alias": "condition", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core condition table", "columns": {"condition_id": {"name": "condition_id", "description": "Unique id for each condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique encounter_id for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Reported date in when the condition began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date in which the condition was resolved.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__condition.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "condition", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.773955, "relation_name": "tuva.core.condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\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": [["core__stg_claims_condition"], ["core__stg_clinical_condition"]], "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 tuva.core._stg_claims_condition\nunion all\nselect * from tuva.core._stg_clinical_condition\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__eligibility": {"database": "tuva", "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": "6c4444c95ace83c2f6bc4f2e9dfc69bef360c3b0a01bea5e67b3da4761485111"}, "config": {"enabled": true, "alias": "eligibility", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core eligibility table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__eligibility.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "eligibility", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.784944, "relation_name": "tuva.core.eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_eligibility')}}", "language": "sql", "refs": [["core__stg_claims_eligibility"]], "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 tuva.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__encounter": {"database": "tuva", "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": "2cf0a388e7ed3dbd677997974437d8ac82992cf599c035a9b3e6a66d2cfeb133"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the encounter (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code relevant to the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__encounter.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "encounter", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.7974346, "relation_name": "tuva.core.encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\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": [["core__stg_clinical_encounter"]], "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 tuva.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__lab_result": {"database": "tuva", "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": "f9476ba4518a0bd40ed1de34b409cd2a90558632afa56fb482ab58b016ad4ab9"}, "config": {"enabled": true, "alias": "lab_result", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__lab_result.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "lab_result", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8010163, "relation_name": "tuva.core.lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_clinical_lab_result')}}", "language": "sql", "refs": [["core__stg_clinical_lab_result"]], "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 tuva.core._stg_clinical_lab_result", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__location": {"database": "tuva", "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": "c37dfb21d3e6de4641e1cb7413e8f44db8eab3f488ee294f7cec3f1e04518273"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__location.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "location", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8043895, "relation_name": "tuva.core.location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_location"], ["core__stg_clinical_location"]], "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 tuva.core._stg_claims_location\nunion all\nselect * from tuva.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__medical_claim": {"database": "tuva", "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": "b126bbc3a07a5f93f701d0199e8fde6ef13a7fd9ac7ad71619de948a8d49fdc1"}, "config": {"enabled": true, "alias": "medical_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core medical_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "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", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__medical_claim.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "medical_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.823199, "relation_name": "tuva.core.medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_medical_claim')}}", "language": "sql", "refs": [["core__stg_claims_medical_claim"]], "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 tuva.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__medication": {"database": "tuva", "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": "465c23d0e83d37bcd661cec2d9e6b14101d171d7dc5b1481e9ef8e0580998512"}, "config": {"enabled": true, "alias": "medication", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__medication.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "medication", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8268013, "relation_name": "tuva.core.medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_medication')}}", "language": "sql", "refs": [["core__stg_clinical_medication"]], "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 tuva.core._stg_clinical_medication", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__observation": {"database": "tuva", "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": "8e922586d391bb227ab514044d20f47f328a489ae785158adf2d12a7f1c84d4b"}, "config": {"enabled": true, "alias": "observation", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__observation.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "observation", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8308105, "relation_name": "tuva.core.observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_observation')}}", "language": "sql", "refs": [["core__stg_clinical_observation"]], "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 tuva.core._stg_clinical_observation", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__patient": {"database": "tuva", "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": "b61f67fdabee3aa43bcbc17b1deb9f655a317e812c6571a11caf3f26b22e2ed8"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core patient table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__patient.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "patient", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8397985, "relation_name": "tuva.core.patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_patient"], ["core__stg_clinical_patient"]], "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 tuva.core._stg_claims_patient\nunion all\nselect * from tuva.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__pharmacy_claim": {"database": "tuva", "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": "d6e2bac51e9f18580249d402ed5ddc88c616d33d70781c4adf4dfd980499f836"}, "config": {"enabled": true, "alias": "pharmacy_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core pharmacy_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__pharmacy_claim.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "pharmacy_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8526347, "relation_name": "tuva.core.pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_claims_pharmacy_claim')}}", "language": "sql", "refs": [["core__stg_claims_pharmacy_claim"]], "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 tuva.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__practitioner": {"database": "tuva", "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": "775c1a9019c7dad8bd26cdb669cfa8f56e61ced3adcb492b805165d42f20eacf"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core provider table with all providers in the claims dataset", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__practitioner.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "practitioner", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8600311, "relation_name": "tuva.core.practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_practitioner"], ["core__stg_clinical_practitioner"]], "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 tuva.core._stg_claims_practitioner\nunion all\nselect * from tuva.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__procedure": {"database": "tuva", "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": "2ec212aa41f812304773bc51f2ae8bd67767d75b2fb2f29f79ad916c04ba83d2"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core procedure table", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\final\\core__procedure.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "procedure", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.869614, "relation_name": "tuva.core.procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_procedure"], ["core__stg_clinical_procedure"]], "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 tuva.core._stg_claims_procedure\nunion all\nselect * from tuva.core._stg_clinical_procedure\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_condition": {"database": "tuva", "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": "384e649ee9371b292504d2c97bf6e209c303195f1e100b54f219921b5fa549e7"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core condition table", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique encounter_id for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Date in which the condition occured.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_condition.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_condition", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9176636, "relation_name": "tuva.core._stg_claims_condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n\t discharge_date,\r\n\t claim_end_date,\r\n\t claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('medical_claim') }} \r\nwhere diagnosis_code_25 is not null\r\n\r\n)\r\n\r\nselect distinct\r\n null as condition_id,\r\n unpivot_cte.patient_id,\r\n eg.encounter_id,\r\n unpivot_cte.claim_id,\r\n unpivot_cte.condition_date as recorded_date,\r\n null as onset_date,\r\n null as resolved_date,\r\n 'active' as status,\r\n unpivot_cte.condition_type as condition_type,\r\n unpivot_cte.source_code_type as source_code_type,\r\n unpivot_cte.source_code as source_code,\r\n null as source_description,\r\n case\r\n when icd.icd_10_cm is not null then 'icd-10-cm'\r\n end as normalized_code_type,\r\n icd.icd_10_cm as normalized_code,\r\n icd.description as normalized_description,\r\n unpivot_cte.diagnosis_rank as condition_rank,\r\n unpivot_cte.present_on_admit_code as present_on_admit_code,\r\n poa.present_on_admit_description as present_on_admit_description,\r\n unpivot_cte.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom unpivot_cte\r\nleft join {{ ref('acute_inpatient__encounter_data_for_medical_claims')}} as eg\r\n on unpivot_cte.claim_id = eg.claim_id\r\n and unpivot_cte.patient_id = eg.patient_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": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["acute_inpatient__encounter_data_for_medical_claims"], ["terminology__icd_10_cm"], ["terminology__present_on_admission"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "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": "\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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n\t discharge_date,\n\t claim_end_date,\n\t claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.medical_claim \nwhere diagnosis_code_25 is not null\n\n)\n\nselect distinct\n null as condition_id,\n unpivot_cte.patient_id,\n eg.encounter_id,\n unpivot_cte.claim_id,\n unpivot_cte.condition_date as recorded_date,\n null as onset_date,\n null as resolved_date,\n 'active' as status,\n unpivot_cte.condition_type as condition_type,\n unpivot_cte.source_code_type as source_code_type,\n unpivot_cte.source_code as source_code,\n null as source_description,\n case\n when icd.icd_10_cm is not null then 'icd-10-cm'\n end as normalized_code_type,\n icd.icd_10_cm as normalized_code,\n icd.description as normalized_description,\n unpivot_cte.diagnosis_rank as condition_rank,\n unpivot_cte.present_on_admit_code as present_on_admit_code,\n poa.present_on_admit_description as present_on_admit_description,\n unpivot_cte.data_source,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom unpivot_cte\nleft join tuva.claims_preprocessing._int_encounter_data_for_medical_claims as eg\n on unpivot_cte.claim_id = eg.claim_id\n and unpivot_cte.patient_id = eg.patient_id\nleft join tuva.terminology.icd_10_cm icd\n on unpivot_cte.source_code = icd.icd_10_cm\nleft join tuva.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": []}, "model.the_tuva_project.core__stg_claims_eligibility": {"database": "tuva", "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": "08add46bceb7f3be60c8ab11301f4113c5a329c696baa328dcc0a294b1d803bb"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core eligibility table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_eligibility.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_eligibility", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9457252, "relation_name": "tuva.core._stg_claims_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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(gender as {{ dbt.type_string() }} ) as gender\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 integer ) as death_flag\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(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(first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\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(phone as {{ dbt.type_string() }} ) as phone\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('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_eligibility.sql", "compiled": true, "compiled_code": "\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(gender as TEXT ) as gender\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 integer ) as death_flag\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(dual_status_code as TEXT ) as dual_status_code\n , cast(medicare_status_code as TEXT ) as medicare_status_code\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\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(phone as TEXT ) as phone\n , cast(data_source as TEXT ) as data_source\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "tuva", "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": "e3f677d9ee8d980fedb9ae7f727f1416066fbee1ff1817ef874ea881205b14fc"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core encounter table", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the encounter (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the encounter (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_encounter.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_encounter", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8988745, "relation_name": "tuva.core._stg_claims_encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 encounter_id\r\n, patient_id\r\n, 'acute inpatient' as encounter_type\r\n, encounter_start_date\r\n, encounter_end_date\r\n, length_of_stay\r\n, admit_source_code\r\n, admit_source_description\r\n, admit_type_code\r\n, admit_type_description\r\n, discharge_disposition_code\r\n, discharge_disposition_description\r\n, null as attending_provider_id\r\n, facility_npi\r\n, null as primary_diagnosis_code\r\n, null as primary_diagnosis_description\r\n, ms_drg_code\r\n, ms_drg_description\r\n, apr_drg_code\r\n, apr_drg_description\r\n, total_paid_amount as paid_amount\r\n, total_allowed_amount as allowed_amount\r\n, total_charge_amount as charge_amount\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__summary') }}", "language": "sql", "refs": [["acute_inpatient__summary"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_encounter.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model creates the encounter table in core.\n-- *************************************************\n\nselect\n encounter_id\n, patient_id\n, 'acute inpatient' as encounter_type\n, encounter_start_date\n, encounter_end_date\n, length_of_stay\n, admit_source_code\n, admit_source_description\n, admit_type_code\n, admit_type_description\n, discharge_disposition_code\n, discharge_disposition_description\n, null as attending_provider_id\n, facility_npi\n, null as primary_diagnosis_code\n, null as primary_diagnosis_description\n, ms_drg_code\n, ms_drg_description\n, apr_drg_code\n, apr_drg_description\n, total_paid_amount as paid_amount\n, total_allowed_amount as allowed_amount\n, total_charge_amount as charge_amount\n, data_source\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.acute_inpatient_summary", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_location": {"database": "tuva", "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": "c5734f9fd0a7f55c19335cfe47f73ff8c268e253162ebebb90838efc15949952"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core patient table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_location.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_location", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9029412, "relation_name": "tuva.core._stg_claims_location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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) = 'organization'\r\n)\r\n\r\n\r\n\r\nselect \r\n npi as location_id\r\n , npi\r\n , provider_organization_name as name\r\n , null as facility_type\r\n , parent_organization_name as parent_organization\r\n , practice_address_line_1 as address\r\n , practice_city as city\r\n , practice_state as state\r\n , practice_zip_code as zip_code\r\n , null as latitude\r\n , null as longitude\r\n , data_source as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["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": "\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom tuva.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 npi as location_id\n , npi\n , provider_organization_name as name\n , null as facility_type\n , parent_organization_name as parent_organization\n , practice_address_line_1 as address\n , practice_city as city\n , practice_state as state\n , practice_zip_code as zip_code\n , null as latitude\n , null as longitude\n , data_source as data_source\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "tuva", "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": "a4cb47e9ba687734d793755eb0e00d4f1338767329a4f93c53bc5e11b9c538f3"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core medical_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "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", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_medical_claim.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_medical_claim", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.8860257, "relation_name": "tuva.core._stg_claims_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 med.claim_id\r\n , med.claim_line_number\r\n , enc.encounter_id\r\n , med.claim_type\r\n , med.patient_id\r\n , med.member_id\r\n , med.claim_start_date\r\n , med.claim_end_date\r\n , med.claim_line_start_date\r\n , med.claim_line_end_date\r\n , med.admission_date\r\n , med.discharge_date\r\n , srv_group.service_category_1\r\n , srv_group.service_category_2\r\n , med.admit_source_code\r\n , med.admit_type_code\r\n , med.discharge_disposition_code\r\n , med.place_of_service_code\r\n , med.bill_type_code\r\n , med.ms_drg_code\r\n , med.apr_drg_code\r\n , med.revenue_center_code\r\n , med.service_unit_quantity\r\n , med.hcpcs_code\r\n , med.hcpcs_modifier_1\r\n , med.hcpcs_modifier_2\r\n , med.hcpcs_modifier_3\r\n , med.hcpcs_modifier_4\r\n , med.hcpcs_modifier_5\r\n , med.rendering_npi\r\n , med.billing_npi\r\n , med.facility_npi\r\n , med.paid_date\r\n , med.paid_amount\r\n , med.allowed_amount\r\n , med.charge_amount\r\n , med.total_cost_amount\r\n , med.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} med\r\ninner 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') }} enc\r\n on med.claim_id = enc.claim_id", "language": "sql", "refs": [["medical_claim"], ["service_category__service_category_grouper"], ["acute_inpatient__encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.acute_inpatient__encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_medical_claim.sql", "compiled": true, "compiled_code": "\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 med.claim_id\n , med.claim_line_number\n , enc.encounter_id\n , med.claim_type\n , med.patient_id\n , med.member_id\n , med.claim_start_date\n , med.claim_end_date\n , med.claim_line_start_date\n , med.claim_line_end_date\n , med.admission_date\n , med.discharge_date\n , srv_group.service_category_1\n , srv_group.service_category_2\n , med.admit_source_code\n , med.admit_type_code\n , med.discharge_disposition_code\n , med.place_of_service_code\n , med.bill_type_code\n , med.ms_drg_code\n , med.apr_drg_code\n , med.revenue_center_code\n , med.service_unit_quantity\n , med.hcpcs_code\n , med.hcpcs_modifier_1\n , med.hcpcs_modifier_2\n , med.hcpcs_modifier_3\n , med.hcpcs_modifier_4\n , med.hcpcs_modifier_5\n , med.rendering_npi\n , med.billing_npi\n , med.facility_npi\n , med.paid_date\n , med.paid_amount\n , med.allowed_amount\n , med.charge_amount\n , med.total_cost_amount\n , med.data_source\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim med\ninner join tuva.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 tuva.claims_preprocessing._int_acute_inpatient_encounter_id enc\n on med.claim_id = enc.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_patient": {"database": "tuva", "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": "022365e5d5d9bbb9fcce554d89cbc7affc6c1296ac9ec87b02ecc6ba09509d52"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core patient table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_patient.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_patient", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9094753, "relation_name": "tuva.core._stg_claims_patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 ,gender\r\n ,race\r\n ,birth_date\r\n ,death_date\r\n ,death_flag\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 ,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('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(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 , null as county\r\n , null as latitude \r\n , null as longitude\r\n ,cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patient_stage\r\nwhere row_sequence = 1", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_patient.sql", "compiled": true, "compiled_code": "\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 ,gender\n ,race\n ,birth_date\n ,death_date\n ,death_flag\n ,first_name\n ,last_name\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 tuva.claims_data_model.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(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 , null as county\n , null as latitude \n , null as longitude\n ,cast(data_source as TEXT) as data_source\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "tuva", "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": "b6cf9d784d80295a9d94102f3406a486f62c3e41dccff6ff32e9a1d336a276c6"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core pharmacy_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_pharmacy_claim", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9342902, "relation_name": "tuva.core._stg_claims_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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(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(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "compiled": true, "compiled_code": "\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(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(data_source as TEXT ) as data_source\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "tuva", "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": "48850b9061949a17ebdab2d77a3fe52bc224f9b1cd0fb661ae7f4cbd150e1b8d"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core provider table with all providers in the claims dataset", "columns": {"npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "entity_type_code": {"name": "entity_type_code", "description": "Code that describes the type of provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entity_type_description": {"name": "entity_type_description", "description": "Description of the type of provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_taxonomy_code": {"name": "primary_taxonomy_code", "description": "Code corresponding to the primary specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_specialty_description": {"name": "primary_specialty_description", "description": "Description of the primary specialty for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_name": {"name": "provider_name", "description": "Name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_organization_name": {"name": "parent_organization_name", "description": "Name of the parent organization for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_address_line_1": {"name": "practice_address_line_1", "description": "The first line of the address for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_address_line_2": {"name": "practice_address_line_2", "description": "The second line of the address for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_city": {"name": "practice_city", "description": "The city where the provider is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_state": {"name": "practice_state", "description": "The state where the provider is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_zip_code": {"name": "practice_zip_code", "description": "The zip code for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_updated": {"name": "last_updated", "description": "Date when the data for this provider was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deactivation_date": {"name": "deactivation_date", "description": "Date when this NPI was deactivated if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deactivation_flag": {"name": "deactivation_flag", "description": "Flag indicating if this NPI was deactivated.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_practitioner.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_practitioner", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9539537, "relation_name": "tuva.core._stg_claims_practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 npi as practitioner_id\r\n , npi\r\n , provider_first_name\r\n , provider_last_name\r\n , parent_organization_name as practice_affiliation\r\n , primary_specialty_description as specialty\r\n , null as sub_specialty\r\n , data_source as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["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": "\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 tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom tuva.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 npi as practitioner_id\n , npi\n , provider_first_name\n , provider_last_name\n , parent_organization_name as practice_affiliation\n , primary_specialty_description as specialty\n , null as sub_specialty\n , data_source as data_source\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "tuva", "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": "f6d95af087eaf1830b09a880bbdc9b4bc8306e8168b51964506b792122039b9b"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core procedure table", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "Type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_npi": {"name": "practitioner_npi", "description": "NPI of the provider who performed the procedure.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_claims_procedure.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_procedure", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9248192, "relation_name": "tuva.core._stg_claims_procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the procedure table in core.\r\n-- *************************************************\r\n\r\n\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 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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('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 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('medical_claim') }} \r\nwhere procedure_code_25 is not null\r\n\r\n)\r\n\r\n\r\nselect distinct\r\n null as procedure_id,\r\n unpivot_cte.patient_id as patient_id,\r\n eg.encounter_id as encounter_id,\r\n unpivot_cte.claim_id as claim_id,\r\n unpivot_cte.procedure_date as procedure_date,\r\n unpivot_cte.source_code_type as source_code_type,\r\n unpivot_cte.source_code as source_code,\r\n null as source_description,\r\n case\r\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\r\n end as normalized_code_type,\r\n icd.icd_10_pcs as normalized_code,\r\n icd.description as normalized_description,\r\n unpivot_cte.modifier_1,\r\n unpivot_cte.modifier_2,\r\n unpivot_cte.modifier_3,\r\n unpivot_cte.modifier_4,\r\n null as modifier_5,\r\n unpivot_cte.practitioner_npi as practitioner_id,\r\n unpivot_cte.data_source as data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom unpivot_cte\r\n left join {{ ref('terminology__icd_10_pcs') }} as icd\r\n on unpivot_cte.source_code = icd.icd_10_pcs\r\n left join {{ ref('acute_inpatient__encounter_data_for_medical_claims')}} as eg\r\n on unpivot_cte.claim_id = eg.claim_id\r\n and unpivot_cte.patient_id = eg.patient_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["terminology__icd_10_pcs"], ["acute_inpatient__encounter_data_for_medical_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_procedure.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model creates the procedure table in core.\n-- *************************************************\n\n\n\n\nwith unpivot_cte as (\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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.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 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 tuva.claims_data_model.medical_claim \nwhere procedure_code_25 is not null\n\n)\n\n\nselect distinct\n null as procedure_id,\n unpivot_cte.patient_id as patient_id,\n eg.encounter_id as encounter_id,\n unpivot_cte.claim_id as claim_id,\n unpivot_cte.procedure_date as procedure_date,\n unpivot_cte.source_code_type as source_code_type,\n unpivot_cte.source_code as source_code,\n null as source_description,\n case\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\n end as normalized_code_type,\n icd.icd_10_pcs as normalized_code,\n icd.description as normalized_description,\n unpivot_cte.modifier_1,\n unpivot_cte.modifier_2,\n unpivot_cte.modifier_3,\n unpivot_cte.modifier_4,\n null as modifier_5,\n unpivot_cte.practitioner_npi as practitioner_id,\n unpivot_cte.data_source as data_source,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom unpivot_cte\n left join tuva.terminology.icd_10_pcs as icd\n on unpivot_cte.source_code = icd.icd_10_pcs\n left join tuva.claims_preprocessing._int_encounter_data_for_medical_claims as eg\n on unpivot_cte.claim_id = eg.claim_id\n and unpivot_cte.patient_id = eg.patient_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_condition": {"database": "tuva", "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": "48aacec28555bd2dbab6f55cef0c55c7392b58420a971fd0dc5d3a0fb0038d70"}, "config": {"enabled": true, "alias": "_stg_clinical_condition", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_condition.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_condition", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.956458, "relation_name": "tuva.core._stg_clinical_condition", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n condition_id\r\n , patient_id\r\n , encounter_id\r\n , claim_id\r\n , recorded_date\r\n , onset_date\r\n , resolved_date\r\n , status\r\n , condition_type\r\n , source_code_type\r\n , source_code\r\n , source_description\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , condition_rank\r\n , present_on_admit_code\r\n , present_on_admit_description\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('condition') }}", "language": "sql", "refs": [["condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_condition.sql", "compiled": true, "compiled_code": "\n\nselect\n condition_id\n , patient_id\n , encounter_id\n , claim_id\n , recorded_date\n , onset_date\n , resolved_date\n , status\n , condition_type\n , source_code_type\n , source_code\n , source_description\n , normalized_code_type\n , normalized_code\n , normalized_description\n , condition_rank\n , present_on_admit_code\n , present_on_admit_description\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "tuva", "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": "7169c07706509cade9f8f3d3a3ef9c85de174ac5ff25ebf9ef3145bef59d5d32"}, "config": {"enabled": true, "alias": "_stg_clinical_encounter", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_encounter.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_encounter", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9601321, "relation_name": "tuva.core._stg_clinical_encounter", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id\r\n , patient_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , length_of_stay\r\n , admit_source_code\r\n , admit_source_description\r\n , admit_type_code\r\n , admit_type_description\r\n , discharge_disposition_code\r\n , discharge_disposition_description\r\n , attending_provider_id\r\n , facility_npi\r\n , primary_diagnosis_code\r\n , primary_diagnosis_description\r\n , ms_drg_code\r\n , ms_drg_description\r\n , apr_drg_code\r\n , apr_drg_description\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('encounter') }}", "language": "sql", "refs": [["encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_encounter.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id\n , patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , admit_source_code\n , admit_source_description\n , admit_type_code\n , admit_type_description\n , discharge_disposition_code\n , discharge_disposition_description\n , attending_provider_id\n , facility_npi\n , primary_diagnosis_code\n , primary_diagnosis_description\n , ms_drg_code\n , ms_drg_description\n , apr_drg_code\n , apr_drg_description\n , paid_amount\n , allowed_amount\n , charge_amount\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.encounter", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "tuva", "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": "2d21dfa2ec263b7092949558f9f69bc7a6de78a5ac70d90461b95f0f16cfdea1"}, "config": {"enabled": true, "alias": "_stg_clinical_lab_result", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_lab_result.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_lab_result", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9631066, "relation_name": "tuva.core._stg_clinical_lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n lab_result_id\r\n , patient_id\r\n , encounter_id\r\n , accession_number\r\n , source_code_type\r\n , source_code\r\n , source_description\r\n , source_component\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , normalized_component\r\n , status\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_units\r\n , normalized_units\r\n , source_reference_range_low\r\n , source_reference_range_high\r\n , normalized_reference_range_low\r\n , normalized_reference_range_high\r\n , source_abnormal_flag\r\n , normalized_abnormal_flag\r\n , specimen\r\n , ordering_practitioner_id\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('lab_result') }}", "language": "sql", "refs": [["lab_result"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 lab_result_id\n , patient_id\n , encounter_id\n , accession_number\n , source_code_type\n , source_code\n , source_description\n , source_component\n , normalized_code_type\n , normalized_code\n , normalized_description\n , normalized_component\n , status\n , result\n , result_date\n , collection_date\n , source_units\n , normalized_units\n , source_reference_range_low\n , source_reference_range_high\n , normalized_reference_range_low\n , normalized_reference_range_high\n , source_abnormal_flag\n , normalized_abnormal_flag\n , specimen\n , ordering_practitioner_id\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.lab_result", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_location": {"database": "tuva", "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": "c394f86c68d4344ae46f09c7ff829d12751f20cad6dafadf486a35e5088eb5c8"}, "config": {"enabled": true, "alias": "_stg_clinical_location", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_location.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_location", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9660964, "relation_name": "tuva.core._stg_clinical_location", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n location_id\r\n , npi\r\n , name\r\n , facility_type\r\n , parent_organization\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , latitude\r\n , longitude\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('location') }}", "language": "sql", "refs": [["location"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_location.sql", "compiled": true, "compiled_code": "\n\nselect\n location_id\n , npi\n , name\n , facility_type\n , parent_organization\n , address\n , city\n , state\n , zip_code\n , latitude\n , longitude\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.location", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "tuva", "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": "6ab6b24ee3ac550203af882cb6c31626e082d532ba4365d5df3a999c4760e9f8"}, "config": {"enabled": true, "alias": "_stg_clinical_medication", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_medication.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_medication", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9696078, "relation_name": "tuva.core._stg_clinical_medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n medication_id\r\n , patient_id\r\n , encounter_id\r\n , dispensing_date\r\n , prescribing_date\r\n , source_code_type\r\n , source_code\r\n , source_description\r\n , ndc_code\r\n , ndc_description\r\n , rxnorm_code\r\n , rxnorm_description\r\n , atc_code\r\n , atc_description\r\n , route\r\n , strength\r\n , quantity\r\n , quantity_unit\r\n , days_supply\r\n , practitioner_id\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('medication') }}", "language": "sql", "refs": [["medication"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_medication.sql", "compiled": true, "compiled_code": "\n\nselect\n medication_id\n , patient_id\n , encounter_id\n , dispensing_date\n , prescribing_date\n , source_code_type\n , source_code\n , source_description\n , ndc_code\n , ndc_description\n , rxnorm_code\n , rxnorm_description\n , atc_code\n , atc_description\n , route\n , strength\n , quantity\n , quantity_unit\n , days_supply\n , practitioner_id\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.medication", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "tuva", "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": "0c223c552eccf5fd6b68353234a9e6322c4d376eb7844cbe735c66e9895dce9d"}, "config": {"enabled": true, "alias": "_stg_clinical_observation", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_observation.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_observation", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.973114, "relation_name": "tuva.core._stg_clinical_observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect\r\n observation_id\r\n , patient_id\r\n , encounter_id\r\n , panel_id\r\n , observation_date\r\n , observation_type\r\n , source_code_type\r\n , source_code\r\n , source_description\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , result\r\n , source_units\r\n , normalized_units\r\n , source_reference_range_low\r\n , source_reference_range_high\r\n , normalized_reference_range_low\r\n , normalized_reference_range_high\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('observation') }}", "language": "sql", "refs": [["observation"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_observation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n observation_id\n , patient_id\n , encounter_id\n , panel_id\n , observation_date\n , observation_type\n , source_code_type\n , source_code\n , source_description\n , normalized_code_type\n , normalized_code\n , normalized_description\n , result\n , source_units\n , normalized_units\n , source_reference_range_low\n , source_reference_range_high\n , normalized_reference_range_low\n , normalized_reference_range_high\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.observation", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "tuva", "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": "bcf6f62fe9ccdc56b999805b9cf96540f752cb2f6853b81cd129bb65fab696c0"}, "config": {"enabled": true, "alias": "_stg_clinical_patient", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_patient.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_patient", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.9761038, "relation_name": "tuva.core._stg_clinical_patient", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , first_name\r\n , last_name\r\n , sex\r\n , race\r\n , birth_date\r\n , death_date\r\n , death_flag\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , county\r\n , latitude\r\n , longitude\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('patient') }}", "language": "sql", "refs": [["patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , first_name\n , last_name\n , sex\n , race\n , birth_date\n , death_date\n , death_flag\n , address\n , city\n , state\n , zip_code\n , county\n , latitude\n , longitude\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "tuva", "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": "9871fd705c64de13b62a834cdcb520e25f29140591d085e94a1acd33c9376dea"}, "config": {"enabled": true, "alias": "_stg_clinical_practitioner", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_practitioner.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_practitioner", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.980696, "relation_name": "tuva.core._stg_clinical_practitioner", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n practitioner_id\r\n , npi\r\n , first_name\r\n , last_name\r\n , practice_affiliation\r\n , specialty\r\n , sub_specialty\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('practitioner') }}", "language": "sql", "refs": [["practitioner"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_practitioner.sql", "compiled": true, "compiled_code": "\n\nselect\n practitioner_id\n , npi\n , first_name\n , last_name\n , practice_affiliation\n , specialty\n , sub_specialty\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.practitioner", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "tuva", "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": "d5b7bfbe3183221ae44c35d8f6e039d0af6bd316f6591e2c6c75fe4a960e867d"}, "config": {"enabled": true, "alias": "_stg_clinical_procedure", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_procedure.sql", "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_procedure", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1693946732.983688, "relation_name": "tuva.core._stg_clinical_procedure", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect\r\n procedure_id\r\n , patient_id\r\n , encounter_id\r\n , claim_id\r\n , procedure_date\r\n , source_code_type\r\n , source_code\r\n , source_description\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , modifier_1\r\n , modifier_2\r\n , modifier_3\r\n , modifier_4\r\n , modifier_5\r\n , practitioner_id\r\n , data_source\r\n , tuva_last_run\r\nfrom {{ ref('procedure') }}", "language": "sql", "refs": [["procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n procedure_id\n , patient_id\n , encounter_id\n , claim_id\n , procedure_date\n , source_code_type\n , source_code\n , source_description\n , normalized_code_type\n , normalized_code\n , normalized_description\n , modifier_1\n , modifier_2\n , modifier_3\n , modifier_4\n , modifier_5\n , practitioner_id\n , data_source\n , tuva_last_run\nfrom tuva.claims_data_model.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "tuva", "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": "5b648f138c2737595b62cfd3be5c9127040551776a7c37406f1cdfcfe84c69e8"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "The payer covering the patient's eligibility", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "member_months", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1693946732.988177, "relation_name": "tuva.financial_pmpm.member_months", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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() }} )\r\n ,lpad(cast(month as {{ dbt.type_string() }}),2,'0')) \r\n 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, '{{ 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": [["terminology__calendar"], ["financial_pmpm__stg_eligibility"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.eligibility\n),month_start_and_end_dates as (\nselect \n concat(cast(year as TEXT )\n ,lpad(cast(month as TEXT),2,'0')) \n as year_month\n, min(full_date) as month_start_date\n, max(full_date) as month_end_date\nfrom tuva.terminology.calendar\ngroup by 1\n)\n\nselect distinct\n a.patient_id\n, year_month\n, a.payer\n, '2023-09-05 20:45:28.914033+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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.eligibility\n)"}]}, "model.the_tuva_project.financial_pmpm__pmpm": {"database": "tuva", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm"], "alias": "pmpm", "checksum": {"name": "sha256", "checksum": "55abe9b601bb585edbeb4ed9e4abdd420700a6173b33ba755d2da9d3b68dda87"}, "config": {"enabled": true, "alias": "pmpm", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm.sql", "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1693946733.0264702, "relation_name": "tuva.financial_pmpm.pmpm", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n)}}\r\n\r\nSELECT \r\n year_month,\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", "language": "sql", "refs": [["financial_pmpm__pmpm_prep"]], "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.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\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 '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nFROM tuva.financial_pmpm.pmpm_prep a\nGROUP BY 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"database": "tuva", "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": "39fa6dabdde64ff73696abadc0645ef26490a55ac02771f671b370c24b20aac9"}, "config": {"enabled": true, "alias": "pmpm_prep", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_prep", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1693946733.004713, "relation_name": "tuva.financial_pmpm.pmpm_prep", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith combine as (\r\nSELECT\r\n a.patient_id,\r\n a.year_month,\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__stg_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\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\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\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)\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": [["financial_pmpm__stg_member_months"], ["financial_pmpm__service_category_1_paid_pivot"], ["financial_pmpm__service_category_2_paid_pivot"], ["financial_pmpm__service_category_1_allowed_pivot"], ["financial_pmpm__service_category_2_allowed_pivot"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__stg_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 __dbt__cte__financial_pmpm__stg_member_months as (\n\n\n\nSELECT\n patient_id\n, year_month\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months\n),combine as (\nSELECT\n a.patient_id,\n a.year_month,\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 __dbt__cte__financial_pmpm__stg_member_months a\nleft join tuva.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\nleft join tuva.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\nleft join tuva.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\nleft join tuva.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)\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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom combine", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_member_months", "sql": " __dbt__cte__financial_pmpm__stg_member_months as (\n\n\n\nSELECT\n patient_id\n, year_month\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months\n)"}]}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "tuva", "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": "c1d249e75f038635be99000e8c153bdf34dfb166f0b7f9e6a7373b3a67fa75d3"}, "config": {"enabled": true, "alias": "_int_patient_spend_with_service_categories", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "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": "#abab26"}}, "created_at": 1693946733.0285027, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith claims_with_service_categories as (\r\nselect \r\n a.patient_id\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\nfrom {{ ref('financial_pmpm__stg_medical_claim') }} a\r\n)\r\n\r\n, medical_claims_year_month as (\r\nselect \r\n patient_id\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\nfrom claims_with_service_categories\r\n)\r\n\r\n, rx_claims as (\r\nselect \r\n patient_id\r\n, 'Pharmacy' as service_category_1\r\n, cast(null as {{ dbt.type_string() }}) as service_category_2\r\n, dispensing_date as claim_date\r\n, paid_amount\r\n, allowed_amount\r\nfrom {{ ref('financial_pmpm__stg_pharmacy_claim') }} \r\n)\r\n\r\n, rx_claims_year_month as (\r\nselect \r\n patient_id\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\nfrom 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, 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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine_medical_and_rx\r\ngroup by 1,2,3,4", "language": "sql", "refs": [["financial_pmpm__stg_medical_claim"], ["financial_pmpm__stg_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim\n),claims_with_service_categories as (\nselect \n a.patient_id\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\nfrom __dbt__cte__financial_pmpm__stg_medical_claim a\n)\n\n, medical_claims_year_month as (\nselect \n patient_id\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\nfrom claims_with_service_categories\n)\n\n, rx_claims as (\nselect \n patient_id\n, 'Pharmacy' as service_category_1\n, cast(null as TEXT) as service_category_2\n, dispensing_date as claim_date\n, paid_amount\n, allowed_amount\nfrom __dbt__cte__financial_pmpm__stg_pharmacy_claim \n)\n\n, rx_claims_year_month as (\nselect \n patient_id\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\nfrom 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, service_category_1\n, service_category_2\n, sum(paid_amount) as total_paid\n, sum(allowed_amount) as total_allowed\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom combine_medical_and_rx\ngroup by 1,2,3,4", "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim\n)"}]}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "tuva", "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": "10c01a7d9c381c5eec9503612a4c16bacaa20356db44adefd3382f7e56639a31"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "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": "#abab26"}}, "created_at": 1693946733.0317748, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_1\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_1\n, sum(total_allowed) as total_allowed\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\n patient_id\n, year_month\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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "tuva", "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": "19834ba067aaae7ba695c5213695a6e98dc2a74b2b5643c951e9557c17620e5a"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "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": "#abab26"}}, "created_at": 1693946733.0367594, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_1\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_1\n, sum(total_paid) as total_paid\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\n patient_id\n, year_month\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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "tuva", "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": "e602da771abe2fbe8ddc02b01897510d5ccfc98a1ae20f3ff8b87682347dc623"}, "config": {"enabled": true, "alias": "_int_service_category_2_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "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": "#abab26"}}, "created_at": 1693946733.0347662, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_2\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\npatient_id, \r\nyear_month, \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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_2\n, sum(total_allowed) as total_allowed\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\npatient_id, \nyear_month, \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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "tuva", "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": "b69fde7c180333a1e92d1741f4e784f3992c1870f3dc44bc0d35607d439b1ff9"}, "config": {"enabled": true, "alias": "_int_service_category_2_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "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": "#abab26"}}, "created_at": 1693946733.0402677, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_2\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\npatient_id, \r\nyear_month, \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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_2\n, sum(total_paid) as total_paid\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\npatient_id, \nyear_month, \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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "tuva", "schema": "claims_data_model", "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": "6f929aa6ba38c735e69bf9d11cee072ca99034e0c84f064a66f50580164c8a71"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1693946733.042265, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [["core__eligibility"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "c388768c61e03729cddff1584573bef76c239a66824250b2c82fc21ca646ca88"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1693946733.044258, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_member_months": {"database": "tuva", "schema": "claims_data_model", "name": "financial_pmpm__stg_member_months", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_member_months.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_member_months.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_member_months", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_member_months"], "alias": "financial_pmpm__stg_member_months", "checksum": {"name": "sha256", "checksum": "09c3df0b70f42c7ccb56bd082269d38c85ec7c0f7b315de607d70d60fd7484b9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1693946733.0462518, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n patient_id\r\n, year_month\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('financial_pmpm__member_months') }}", "language": "sql", "refs": [["financial_pmpm__member_months"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__member_months"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_member_months.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, year_month\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "tuva", "schema": "claims_data_model", "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": "30a2cc87ca3fe2978c95d27531c380940217b319465b4a4e003a2fc137445351"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1693946733.045255, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [["core__pharmacy_claim"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__summary_counts": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__summary_counts", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_counts.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_counts.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__summary_counts", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "final", "quality_measures_reporting__summary_counts"], "alias": "summary_counts", "checksum": {"name": "sha256", "checksum": "3127a400fa80ad97654cab8453cfea49d17f64b157b18a90efc4e404122d1dcf"}, "config": {"enabled": true, "alias": "summary_counts", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator sum after exclusion logic applied. 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, "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator sum after exclusion logic applied. 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, "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, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_counts.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "summary_counts", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0527635, "relation_name": "tuva.quality_measures_reporting.summary_counts", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 from {{ ref('quality_measures_reporting__summary_long') }}\r\n where measure_id is not null\r\n\r\n)\r\n\r\n, apply_exclusions 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 , case\r\n when exclusion_flag = 1 then null\r\n else denominator_flag\r\n end as denominator_flag_adjusted\r\n , case\r\n when exclusion_flag = 1 then null\r\n else numerator_flag\r\n end as numerator_flag_adjusted\r\n from summary_long\r\n\r\n)\r\n\r\n, sum_flags 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_adjusted) as denominator_sum\r\n , sum(numerator_flag_adjusted) as numerator_sum\r\n from apply_exclusions\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, 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 , denominator_sum\r\n , numerator_sum\r\n , (\r\n cast(numerator_sum as {{ dbt.type_numeric() }}) /\r\n cast(denominator_sum as {{ dbt.type_numeric() }})\r\n )*100 as performance_rate\r\n from sum_flags\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 , 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 , performance_rate\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures_reporting__summary_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures_reporting__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__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 from tuva.quality_measures_reporting.summary_long\n where measure_id is not null\n\n)\n\n, apply_exclusions as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , case\n when exclusion_flag = 1 then null\n else denominator_flag\n end as denominator_flag_adjusted\n , case\n when exclusion_flag = 1 then null\n else numerator_flag\n end as numerator_flag_adjusted\n from summary_long\n\n)\n\n, sum_flags 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_adjusted) as denominator_sum\n , sum(numerator_flag_adjusted) as numerator_sum\n from apply_exclusions\n group by\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\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 , denominator_sum\n , numerator_sum\n , (\n cast(numerator_sum as numeric(28,6)) /\n cast(denominator_sum as numeric(28,6))\n )*100 as performance_rate\n from sum_flags\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 , 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 , performance_rate\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__summary_long": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__summary_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_long.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_long.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__summary_long", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "final", "quality_measures_reporting__summary_long"], "alias": "summary_long", "checksum": {"name": "sha256", "checksum": "b31fadde69504f8a501298cd4f6566bb31248ffa38ceb7b891a0874823d5b574"}, "config": {"enabled": true, "alias": "summary_long", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_long.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "summary_long", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0582867, "relation_name": "tuva.quality_measures_reporting.summary_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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_reporting__int_nqf2372_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(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 , 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__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 tuva.quality_measures_reporting._int_nqf2372_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(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 , 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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__summary_wide": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__summary_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_wide.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_wide.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__summary_wide", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "final", "quality_measures_reporting__summary_wide"], "alias": "summary_wide", "checksum": {"name": "sha256", "checksum": "64bcf3bb04b6e21c4eeb28287fea9fc1edde5a797926306fab42a1c73f7a2e25"}, "config": {"enabled": true, "alias": "summary_wide", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "Each measure has a boolean flag which is the result of evaluating the denominator, numerator, and exclusion indicators for the patient. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__summary_wide.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "summary_wide", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.061286, "relation_name": "tuva.quality_measures_reporting.summary_wide", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , measure_id\r\n from {{ ref('quality_measures_reporting__summary_long') }}\r\n\r\n)\r\n\r\n, nqf_2372 as (\r\n\r\n select\r\n patient_id\r\n , case\r\n when denominator_flag = 1\r\n then\r\n case\r\n when exclusion_flag = 1 then null\r\n when exclusion_flag = 0 then numerator_flag\r\n else null\r\n end\r\n end as flag\r\n from measures_long\r\n where measure_id = 'NQF2372'\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.flag as nqf_2372\r\n from measures_long\r\n left join nqf_2372\r\n on measures_long.patient_id = nqf_2372.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 from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , nqf_2372\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures_reporting__summary_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures_reporting__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\final\\quality_measures_reporting__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 , measure_id\n from tuva.quality_measures_reporting.summary_long\n\n)\n\n, nqf_2372 as (\n\n select\n patient_id\n , case\n when denominator_flag = 1\n then\n case\n when exclusion_flag = 1 then null\n when exclusion_flag = 0 then numerator_flag\n else null\n end\n end as flag\n from measures_long\n where measure_id = 'NQF2372'\n\n)\n\n, joined as (\n\n select\n measures_long.patient_id\n , nqf_2372.flag as nqf_2372\n from measures_long\n left join nqf_2372\n on measures_long.patient_id = nqf_2372.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 from joined\n\n)\n\nselect\n patient_id\n , nqf_2372\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_denominator.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_denominator"], "alias": "_int_nqf2372_denominator", "checksum": {"name": "sha256", "checksum": "22cdb1209b5af50350159ed25be1b25f14facf4f0bdec9c8dd7157b415b5bcdf"}, "config": {"enabled": true, "alias": "_int_nqf2372_denominator", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_denominator.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_denominator", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0662692, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n{%- set performance_period_end = var('quality_measure_reporting_period_end') -%}\r\n\r\n{%- set performance_period_begin -%}\r\n{{ dbt.dateadd(datepart=\"month\", interval=-27, from_date_or_timestamp=\"'\"~performance_period_end~\"'\") }}\r\n{%- endset -%}\r\n\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures_reporting__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures_reporting__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures_reporting__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\nwith patient as (\r\n\r\n select\r\n patient_id\r\n , gender\r\n , birth_date\r\n , death_date\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 from {{ ref('quality_measures_reporting__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 from {{ ref('quality_measures_reporting__stg_medical_claim') }}\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_reporting__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_id\r\n , gender\r\n , birth_date\r\n , death_date\r\n , performance_period_begin\r\n , performance_period_end\r\n , floor({{ datediff('birth_date', 'performance_period_begin', 'hour') }} / 8766.0) as age\r\n from patient\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 , performance_period_begin\r\n , performance_period_end\r\n , 1 as denominator_flag\r\n from patient_with_age\r\n where lower(gender) = '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\r\n*/\r\n, qualifying_visits 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 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.performance_period_begin\r\n , patient_filtered.performance_period_end\r\n , patient_filtered.denominator_flag\r\n from patient_filtered\r\n inner join qualifying_visits\r\n on patient_filtered.patient_id = qualifying_visits.patient_id\r\n where qualifying_visits.claim_start_date >= patient_filtered.performance_period_begin\r\n or qualifying_visits.claim_end_date <= patient_filtered.performance_period_end\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({{ 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 , 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": [["quality_measures_reporting__measures"], ["quality_measures_reporting__measures"], ["quality_measures_reporting__measures"], ["quality_measures_reporting__stg_core__patient"], ["quality_measures_reporting__stg_medical_claim"], ["quality_measures_reporting__value_sets"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time", "macro.dbt.dateadd", "macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures_reporting__measures", "seed.the_tuva_project.quality_measures_reporting__measures", "seed.the_tuva_project.quality_measures_reporting__measures", "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "seed.the_tuva_project.quality_measures_reporting__value_sets"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_denominator.sql", "compiled": true, "compiled_code": "with __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n), __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),patient as (\n\n select\n patient_id\n , gender\n , birth_date\n , death_date\n , cast(\n\n dateadd(\n month,\n -27,\n '2023-09-05'\n )\n\n as date) as performance_period_begin\n , cast('2023-09-05'as date) as performance_period_end\n from __dbt__cte__quality_measures_reporting__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 from __dbt__cte__quality_measures_reporting__stg_medical_claim\n\n)\n\n, visit_codes as (\n\n select\n code\n , code_system\n from tuva.quality_measures_reporting._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_id\n , gender\n , birth_date\n , death_date\n , performance_period_begin\n , performance_period_end\n , floor(datediff(\n hour,\n birth_date,\n performance_period_begin\n ) / 8766.0) as age\n from patient\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 , performance_period_begin\n , performance_period_end\n , 1 as denominator_flag\n from patient_with_age\n where lower(gender) = 'female'\n and age between 51 and 74\n and death_date is null\n\n)\n\n/*\n Filter to qualifying visit types\n*/\n, qualifying_visits 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 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.performance_period_begin\n , patient_filtered.performance_period_end\n , patient_filtered.denominator_flag\n from patient_filtered\n inner join qualifying_visits\n on patient_filtered.patient_id = qualifying_visits.patient_id\n where qualifying_visits.claim_start_date >= patient_filtered.performance_period_begin\n or qualifying_visits.claim_end_date <= patient_filtered.performance_period_end\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((select id\nfrom tuva.quality_measures_reporting._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_id\n , cast((select name\nfrom tuva.quality_measures_reporting._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_name\n , cast((select version\nfrom tuva.quality_measures_reporting._value_set_measures\nwhere id = 'NQF2372') 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 , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "sql": " __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclude_advanced_illness"], "alias": "_int_nqf2372_exclude_advanced_illness", "checksum": {"name": "sha256", "checksum": "653df33f628215512f793af6d5b5a55897732c11791ee210b60b5ff4e99c0aff"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_advanced_illness", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Exclusion logic for patients with frailty and advanced illness 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclude_advanced_illness", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0698333, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclude_advanced_illness", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n\r\n AND either one acute inpatient encounter with a diagnosis of advanced\r\n illness\r\n\r\n OR two outpatient, observation, ED or nonacute inpatient encounters on\r\n different dates of service with an advanced illness diagnosis during\r\n measurement period or the year prior to measurement period\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_reporting__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_reporting__value_sets') }}\r\n where concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\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 , condition_date\r\n , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__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_reporting__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 , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__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.condition_date\r\n , conditions.code_type\r\n , conditions.code\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_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 , procedures.code_type\r\n , procedures.code\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/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n*/\r\n, patients_with_frailty 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 from denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where denominator.age >= 66\r\n and med_claim_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n where denominator.age >= 66\r\n and condition_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and condition_exclusions.condition_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n where denominator.age >= 66\r\n and procedure_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n)\r\n\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n\r\n AND one acute inpatient encounter with a diagnosis of advanced illness\r\n during measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\r\n || ' with '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\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 med_claim_exclusions.concept_name = 'Acute Inpatient'\r\n and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n)\r\n\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n\r\n AND two outpatient, observation, ED or nonacute inpatient encounters\r\n on different dates of service with an advanced illness diagnosis during\r\n measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\r\n || ' with '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\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 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 and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n)\r\n\r\n/*\r\n Filter to patients who have had one acute inpatient encounter or\r\n two nonacute outpatient encounters\r\n*/\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , count(*) as encounter_count\r\n from acute_inpatient\r\n group by patient_id\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , count(*) as encounter_count\r\n from nonacute_outpatient\r\n group by patient_id\r\n\r\n)\r\n\r\n, eligible_acute_inpatient 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 from acute_inpatient\r\n left join acute_inpatient_counts\r\n on acute_inpatient.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n)\r\n\r\n, eligible_nonacute_outpatient as (\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 from nonacute_outpatient\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n eligible_acute_inpatient.patient_id\r\n , eligible_acute_inpatient.exclusion_date\r\n , eligible_acute_inpatient.exclusion_reason\r\n from eligible_acute_inpatient\r\n\r\n union all\r\n\r\n select\r\n eligible_nonacute_outpatient.patient_id\r\n , eligible_nonacute_outpatient.exclusion_date\r\n , eligible_nonacute_outpatient.exclusion_reason\r\n from eligible_nonacute_outpatient\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\nfrom exclusions_unioned", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__value_sets"], ["quality_measures_reporting__stg_core__condition"], ["quality_measures_reporting__stg_medical_claim"], ["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures_reporting__value_sets", "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql", "compiled": true, "compiled_code": "\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n\n AND either one acute inpatient encounter with a diagnosis of advanced\n illness\n\n OR two outpatient, observation, ED or nonacute inpatient encounters on\n different dates of service with an advanced illness diagnosis during\n measurement period or the year prior to measurement period\n*/\n\nwith __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n), __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from tuva.quality_measures_reporting._value_set_codes\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\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 , condition_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__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_reporting__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.condition_date\n , conditions.code_type\n , conditions.code\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_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 , procedures.code_type\n , procedures.code\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/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n*/\n, patients_with_frailty as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where denominator.age >= 66\n and med_claim_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n where denominator.age >= 66\n and condition_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and condition_exclusions.condition_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n where denominator.age >= 66\n and procedure_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n)\n\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n\n AND one acute inpatient encounter with a diagnosis of advanced illness\n during measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\n || ' with '\n || condition_exclusions.concept_name\n as exclusion_reason\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 med_claim_exclusions.concept_name = 'Acute Inpatient'\n and condition_exclusions.concept_name = 'Advanced Illness'\n and (\n med_claim_exclusions.claim_start_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n or med_claim_exclusions.claim_end_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n)\n\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n\n AND two outpatient, observation, ED or nonacute inpatient encounters\n on different dates of service with an advanced illness diagnosis during\n measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\n || ' with '\n || condition_exclusions.concept_name\n as exclusion_reason\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 med_claim_exclusions.concept_name in (\n 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n and condition_exclusions.concept_name = 'Advanced Illness'\n and (\n med_claim_exclusions.claim_start_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n or med_claim_exclusions.claim_end_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n)\n\n/*\n Filter to patients who have had one acute inpatient encounter or\n two nonacute outpatient encounters\n*/\n, acute_inpatient_counts as (\n\n select\n patient_id\n , count(*) as encounter_count\n from acute_inpatient\n group by patient_id\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , count(*) as encounter_count\n from nonacute_outpatient\n group by patient_id\n\n)\n\n, eligible_acute_inpatient as (\n\n select\n acute_inpatient.patient_id\n , acute_inpatient.exclusion_date\n , acute_inpatient.exclusion_reason\n from acute_inpatient\n left join acute_inpatient_counts\n on acute_inpatient.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n)\n\n, eligible_nonacute_outpatient as (\n\n select\n nonacute_outpatient.patient_id\n , nonacute_outpatient.exclusion_date\n , nonacute_outpatient.exclusion_reason\n from nonacute_outpatient\n left join nonacute_outpatient_counts\n on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n)\n\n, exclusions_unioned as (\n\n select\n eligible_acute_inpatient.patient_id\n , eligible_acute_inpatient.exclusion_date\n , eligible_acute_inpatient.exclusion_reason\n from eligible_acute_inpatient\n\n union all\n\n select\n eligible_nonacute_outpatient.patient_id\n , eligible_nonacute_outpatient.exclusion_date\n , eligible_nonacute_outpatient.exclusion_reason\n from eligible_nonacute_outpatient\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom exclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "sql": " __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclude_dementia", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_dementia.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_dementia.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclude_dementia"], "alias": "_int_nqf2372_exclude_dementia", "checksum": {"name": "sha256", "checksum": "6f5c372ab142709c11b5b4e07667325b5b968017ce2b79222ef5da27fbd0161d"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_dementia", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Exclusion logic for patients with frailty and taking dementia medications 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_dementia.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclude_dementia", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.074544, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclude_dementia", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for frailty\r\n during the measurement period AND a dispensed medication for dementia during the measurement period\r\n or year prior to measurement period\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_reporting__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_reporting__value_sets') }}\r\n where concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n , 'Dementia Medications'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , condition_date\r\n , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__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_reporting__stg_medical_claim') }}\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_reporting__stg_pharmacy_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 , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__stg_core__procedure') }}\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, 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, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.condition_date\r\n , conditions.code_type\r\n , conditions.code\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 , procedures.code_type\r\n , procedures.code\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 denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\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\r\n from denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where denominator.age >= 66\r\n and med_claim_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , condition_exclusions.condition_date as exclusion_date\r\n , condition_exclusions.concept_name\r\n from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n where denominator.age >= 66\r\n and condition_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and condition_exclusions.condition_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n where denominator.age >= 66\r\n and procedure_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\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.concept_name\r\n || ' with '\r\n || pharmacy_claim_exclusions.concept_name\r\n as exclusion_reason\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 where (\r\n pharmacy_claim_exclusions.dispensing_date\r\n between patients_with_frailty.performance_period_begin\r\n and patients_with_frailty.performance_period_end\r\n or pharmacy_claim_exclusions.paid_date\r\n between patients_with_frailty.performance_period_begin\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\nfrom frailty_with_dementia", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__value_sets"], ["quality_measures_reporting__stg_core__condition"], ["quality_measures_reporting__stg_medical_claim"], ["quality_measures_reporting__stg_pharmacy_claim"], ["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures_reporting__value_sets", "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_dementia.sql", "compiled": true, "compiled_code": "\n\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for frailty\n during the measurement period AND a dispensed medication for dementia during the measurement period\n or year prior to measurement period\n*/\n\nwith __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n), __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__quality_measures_reporting__stg_pharmacy_claim as (\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim\n), __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from tuva.quality_measures_reporting._value_set_codes\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n , 'Dementia Medications'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , condition_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__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_reporting__stg_medical_claim\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_reporting__stg_pharmacy_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__stg_core__procedure\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, 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, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.condition_date\n , conditions.code_type\n , conditions.code\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 , procedures.code_type\n , procedures.code\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 denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\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\n from denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where denominator.age >= 66\n and med_claim_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , condition_exclusions.condition_date as exclusion_date\n , condition_exclusions.concept_name\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n where denominator.age >= 66\n and condition_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and condition_exclusions.condition_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n where denominator.age >= 66\n and procedure_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\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.concept_name\n || ' with '\n || pharmacy_claim_exclusions.concept_name\n as exclusion_reason\n from patients_with_frailty\n inner join pharmacy_claim_exclusions\n on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id\n where (\n pharmacy_claim_exclusions.dispensing_date\n between patients_with_frailty.performance_period_begin\n and patients_with_frailty.performance_period_end\n or pharmacy_claim_exclusions.paid_date\n between patients_with_frailty.performance_period_begin\n and patients_with_frailty.performance_period_end\n )\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom frailty_with_dementia", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "sql": " __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_pharmacy_claim as (\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclude_hospice", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_hospice.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_hospice.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclude_hospice"], "alias": "_int_nqf2372_exclude_hospice", "checksum": {"name": "sha256", "checksum": "fd897b84f0bcd17ba5e0934135e4747e396cd637f55cdd6ce8aec6f597ebe98f"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_hospice", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Exclusion logic for patients using hospice services 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_hospice.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclude_hospice", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0798395, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclude_hospice", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n/*\r\n Hospice services used by patient any time during the measurement period\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_reporting__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_reporting__value_sets') }}\r\n where concept_name in (\r\n 'Hospice Care Ambulatory'\r\n , 'Hospice Encounter'\r\n )\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_reporting__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 , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__stg_core__procedure') }}\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, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , procedures.code_type\r\n , procedures.code\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, hospice_claims as (\r\n\r\n select\r\n denominator.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 denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n)\r\n\r\n, hospice_procedures as (\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 where procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from hospice_claims\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 from hospice_procedures\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\nfrom exclusions_unioned", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__value_sets"], ["quality_measures_reporting__stg_medical_claim"], ["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures_reporting__value_sets", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_hospice.sql", "compiled": true, "compiled_code": "\n\n/*\n Hospice services used by patient any time during the measurement period\n*/\n\nwith __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from tuva.quality_measures_reporting._value_set_codes\n where concept_name in (\n 'Hospice Care Ambulatory'\n , 'Hospice Encounter'\n )\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_reporting__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__stg_core__procedure\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, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , procedures.code_type\n , procedures.code\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, hospice_claims as (\n\n select\n denominator.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 denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n\n)\n\n, hospice_procedures as (\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 where procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n)\n\n, exclusions_unioned as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from hospice_claims\n\n union all\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from hospice_procedures\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom exclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclude_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_institutional.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_institutional.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclude_institutional"], "alias": "_int_nqf2372_exclude_institutional", "checksum": {"name": "sha256", "checksum": "d6459cd6ada9b035f9f53b503922a503cec8b39df40cde831de0735278549fc4"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_institutional", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Exclusion logic for patients staying in an institution 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_institutional.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclude_institutional", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0838394, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclude_institutional", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n/*\r\n Patients greater than or equal to 66 in Institutional Special Needs Plans (SNP)\r\n or residing in long term care\r\n\r\n Future enhancement: group claims into encounters\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_reporting__int_nqf2372_denominator') }}\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_reporting__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n denominator.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 denominator\r\n inner join medical_claim\r\n on denominator.patient_id = medical_claim.patient_id\r\n where denominator.age >= 66\r\n and (\r\n medical_claim.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or medical_claim.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n and 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\nfrom exclusions", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_institutional.sql", "compiled": true, "compiled_code": "\n\n/*\n Patients greater than or equal to 66 in Institutional Special Needs Plans (SNP)\n or residing in long term care\n\n Future enhancement: group claims into encounters\n*/\n\nwith __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures_reporting._int_nqf2372_denominator\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_reporting__stg_medical_claim\n\n)\n\n, exclusions as (\n\n select\n denominator.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 denominator\n inner join medical_claim\n on denominator.patient_id = medical_claim.patient_id\n where denominator.age >= 66\n and (\n medical_claim.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or medical_claim.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n and 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\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclude_mastectomy", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclude_mastectomy"], "alias": "_int_nqf2372_exclude_mastectomy", "checksum": {"name": "sha256", "checksum": "7974213065a69d2dedec9ba2107fcda59d331d55774555b731dc00a71a45af3d"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_mastectomy", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclude_mastectomy", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0898468, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclude_mastectomy", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n/*\r\n Patients that had a mastectomy performed or who have a history of 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_reporting__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_reporting__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 , condition_date\r\n , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__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 , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__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.condition_date\r\n , conditions.code_type\r\n , conditions.code\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 , procedures.code_type\r\n , procedures.code\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, mastectomy_conditions as (\r\n\r\n select\r\n denominator.patient_id\r\n , condition_exclusions.condition_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)\r\n\r\n, mastectomy_procedures as (\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, exclusions_unioned as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from mastectomy_conditions\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 from mastectomy_procedures\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\nfrom exclusions_unioned", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__value_sets"], ["quality_measures_reporting__stg_core__condition"], ["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures_reporting__value_sets", "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql", "compiled": true, "compiled_code": "\n\n/*\n Patients that had a mastectomy performed or who have a history of mastectomy\n*/\n\nwith __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n), __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from tuva.quality_measures_reporting._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 , condition_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__stg_core__condition\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.condition_date\n , conditions.code_type\n , conditions.code\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 , procedures.code_type\n , procedures.code\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, mastectomy_conditions as (\n\n select\n denominator.patient_id\n , condition_exclusions.condition_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)\n\n, mastectomy_procedures as (\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, exclusions_unioned as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from mastectomy_conditions\n\n union all\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from mastectomy_procedures\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom exclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "sql": " __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclude_palliative", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_palliative.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_palliative.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclude_palliative"], "alias": "_int_nqf2372_exclude_palliative", "checksum": {"name": "sha256", "checksum": "acc1fa43904a93502f13a368db4ece54ecaadefcc2c035b1f03a6a107a0e6615"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_palliative", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Exclusion logic for patients using palliative services 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_palliative.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclude_palliative", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.0958436, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclude_palliative", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n/*\r\n Palliative care services used by patient any time during the measurement period\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_reporting__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_reporting__value_sets') }}\r\n where concept_name in (\r\n 'Palliative Care Encounter'\r\n , 'Palliative Care Intervention'\r\n )\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_reporting__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 , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__stg_core__procedure') }}\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, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , procedures.code_type\r\n , procedures.code\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, palliative_claims as (\r\n\r\n select\r\n denominator.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 denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n)\r\n\r\n, palliative_procedures as (\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 where procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from palliative_claims\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 from palliative_procedures\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\nfrom exclusions_unioned", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__value_sets"], ["quality_measures_reporting__stg_medical_claim"], ["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures_reporting__value_sets", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclude_palliative.sql", "compiled": true, "compiled_code": "\n\n/*\n Palliative care services used by patient any time during the measurement period\n*/\nwith __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from tuva.quality_measures_reporting._value_set_codes\n where concept_name in (\n 'Palliative Care Encounter'\n , 'Palliative Care Intervention'\n )\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_reporting__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__stg_core__procedure\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, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , procedures.code_type\n , procedures.code\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, palliative_claims as (\n\n select\n denominator.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 denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n\n)\n\n, palliative_procedures as (\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 where procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n)\n\n, exclusions_unioned as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from palliative_claims\n\n union all\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from palliative_procedures\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom exclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclusions.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_exclusions"], "alias": "_int_nqf2372_exclusions", "checksum": {"name": "sha256", "checksum": "5a83771524d56dcb265621dba40ec2e326566aad67db9206a137ee6cbe428a71"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclusions", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclusions.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_exclusions", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.1023982, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, advanced_illness as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures_reporting__int_nqf2372_exclude_advanced_illness') }}\r\n\r\n)\r\n\r\n, dementia as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures_reporting__int_nqf2372_exclude_dementia') }}\r\n\r\n)\r\n\r\n, hospice as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures_reporting__int_nqf2372_exclude_hospice') }}\r\n\r\n)\r\n\r\n, institutional as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures_reporting__int_nqf2372_exclude_institutional') }}\r\n\r\n)\r\n\r\n, mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures_reporting__int_nqf2372_exclude_mastectomy') }}\r\n\r\n)\r\n\r\n, palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures_reporting__int_nqf2372_exclude_palliative') }}\r\n\r\n)\r\n\r\n, denominator_with_advanced_illness 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when advanced_illness.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , advanced_illness.exclusion_date\r\n , advanced_illness.exclusion_reason\r\n from denominator\r\n left join advanced_illness\r\n on denominator.patient_id = advanced_illness.patient_id\r\n\r\n)\r\n\r\n, denominator_with_dementia 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when dementia.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , dementia.exclusion_date\r\n , dementia.exclusion_reason\r\n from denominator\r\n left join dementia\r\n on denominator.patient_id = dementia.patient_id\r\n\r\n)\r\n\r\n, denominator_with_hospice 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when hospice.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , hospice.exclusion_date\r\n , hospice.exclusion_reason\r\n from denominator\r\n left join hospice\r\n on denominator.patient_id = hospice.patient_id\r\n\r\n)\r\n\r\n, denominator_with_institutional 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when institutional.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , institutional.exclusion_date\r\n , institutional.exclusion_reason\r\n from denominator\r\n left join institutional\r\n on denominator.patient_id = institutional.patient_id\r\n\r\n)\r\n\r\n, denominator_with_mastectomy 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when mastectomy.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , mastectomy.exclusion_date\r\n , mastectomy.exclusion_reason\r\n from denominator\r\n left join mastectomy\r\n on denominator.patient_id = mastectomy.patient_id\r\n\r\n)\r\n\r\n, denominator_with_palliative 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when palliative.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , palliative.exclusion_date\r\n , palliative.exclusion_reason\r\n from denominator\r\n left join palliative\r\n on denominator.patient_id = palliative.patient_id\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select * from denominator_with_advanced_illness\r\n union all\r\n select * from denominator_with_dementia\r\n union all\r\n select * from denominator_with_hospice\r\n union all\r\n select * from denominator_with_institutional\r\n union all\r\n select * from denominator_with_mastectomy\r\n union all\r\n select * from denominator_with_palliative\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(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(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n from exclusions_unioned\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 , 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": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__int_nqf2372_exclude_advanced_illness"], ["quality_measures_reporting__int_nqf2372_exclude_dementia"], ["quality_measures_reporting__int_nqf2372_exclude_hospice"], ["quality_measures_reporting__int_nqf2372_exclude_institutional"], ["quality_measures_reporting__int_nqf2372_exclude_mastectomy"], ["quality_measures_reporting__int_nqf2372_exclude_palliative"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_exclusions.sql", "compiled": true, "compiled_code": "\n\n/*\n Eligible population from the denominator model before exclusions\n*/\nwith 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 tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, advanced_illness as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures_reporting._int_nqf2372_exclude_advanced_illness\n\n)\n\n, dementia as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures_reporting._int_nqf2372_exclude_dementia\n\n)\n\n, hospice as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures_reporting._int_nqf2372_exclude_hospice\n\n)\n\n, institutional as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures_reporting._int_nqf2372_exclude_institutional\n\n)\n\n, mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures_reporting._int_nqf2372_exclude_mastectomy\n\n)\n\n, palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures_reporting._int_nqf2372_exclude_palliative\n\n)\n\n, denominator_with_advanced_illness as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when advanced_illness.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , advanced_illness.exclusion_date\n , advanced_illness.exclusion_reason\n from denominator\n left join advanced_illness\n on denominator.patient_id = advanced_illness.patient_id\n\n)\n\n, denominator_with_dementia as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when dementia.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , dementia.exclusion_date\n , dementia.exclusion_reason\n from denominator\n left join dementia\n on denominator.patient_id = dementia.patient_id\n\n)\n\n, denominator_with_hospice as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when hospice.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , hospice.exclusion_date\n , hospice.exclusion_reason\n from denominator\n left join hospice\n on denominator.patient_id = hospice.patient_id\n\n)\n\n, denominator_with_institutional as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when institutional.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , institutional.exclusion_date\n , institutional.exclusion_reason\n from denominator\n left join institutional\n on denominator.patient_id = institutional.patient_id\n\n)\n\n, denominator_with_mastectomy as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when mastectomy.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , mastectomy.exclusion_date\n , mastectomy.exclusion_reason\n from denominator\n left join mastectomy\n on denominator.patient_id = mastectomy.patient_id\n\n)\n\n, denominator_with_palliative as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when palliative.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , palliative.exclusion_date\n , palliative.exclusion_reason\n from denominator\n left join palliative\n on denominator.patient_id = palliative.patient_id\n\n)\n\n, exclusions_unioned as (\n\n select * from denominator_with_advanced_illness\n union all\n select * from denominator_with_dementia\n union all\n select * from denominator_with_hospice\n union all\n select * from denominator_with_institutional\n union all\n select * from denominator_with_mastectomy\n union all\n select * from denominator_with_palliative\n\n)\n\n, add_data_types as (\n\n select\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(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(exclusion_flag as integer) as exclusion_flag\n from exclusions_unioned\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 , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_long.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_long.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_long"], "alias": "_int_nqf2372_long", "checksum": {"name": "sha256", "checksum": "7e74d68a3a712e3434356ad1323560a48901d778d05662f8651848fdaee3be3f"}, "config": {"enabled": true, "alias": "_int_nqf2372_long", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_long.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_long", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.1084216, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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_reporting__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_reporting__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_reporting__int_nqf2372_numerator') }}\r\n\r\n)\r\n\r\n, exclusions 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 , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n from {{ ref('quality_measures_reporting__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 , 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": [["quality_measures_reporting__stg_core__patient"], ["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__int_nqf2372_numerator"], ["quality_measures_reporting__int_nqf2372_exclusions"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__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_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures_reporting__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 tuva.quality_measures_reporting._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 tuva.quality_measures_reporting._int_nqf2372_numerator\n\n)\n\n, exclusions 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 , exclusion_date\n , exclusion_reason\n , exclusion_flag\n from tuva.quality_measures_reporting._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 , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "sql": " __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}]}, "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__int_nqf2372_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_numerator.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "intermediate", "quality_measures_reporting__int_nqf2372_numerator"], "alias": "_int_nqf2372_numerator", "checksum": {"name": "sha256", "checksum": "402eb018739b0052c1d8c844f28c2ee85e4a057d7c6e834df14dbe781d3978c5"}, "config": {"enabled": true, "alias": "_int_nqf2372_numerator", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__int_nqf2372_numerator.sql", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_int_nqf2372_numerator", "tags": "quality_measures_reporting", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1693946733.1139936, "relation_name": "tuva.quality_measures_reporting._int_nqf2372_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures_reporting__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_reporting__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_reporting__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 , code_type\r\n , code\r\n from {{ ref('quality_measures_reporting__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_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , procedures.code_type\r\n , procedures.code\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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , coalesce(\r\n qualifying_procedures.procedure_date\r\n , qualifying_claims.claim_start_date\r\n , qualifying_claims.claim_end_date\r\n ) as evidence_date\r\n , case\r\n when qualifying_claims.claim_start_date >= denominator.performance_period_begin\r\n or qualifying_claims.claim_end_date <= denominator.performance_period_end\r\n then 1\r\n when qualifying_procedures.procedure_date >= denominator.performance_period_begin\r\n or qualifying_procedures.procedure_date <= 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_procedures\r\n on denominator.patient_id = qualifying_procedures.patient_id\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select distinct\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 patients_with_mammograms\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(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 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 , numerator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures_reporting__int_nqf2372_denominator"], ["quality_measures_reporting__value_sets"], ["quality_measures_reporting__stg_medical_claim"], ["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures_reporting__value_sets", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\intermediate\\quality_measures_reporting__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_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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 tuva.quality_measures_reporting._int_nqf2372_denominator\n\n)\n\n, mammography_codes as (\n\n select\n code\n , code_system\n from tuva.quality_measures_reporting._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_reporting__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , code_type\n , code\n from __dbt__cte__quality_measures_reporting__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_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , procedures.code_type\n , procedures.code\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.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , coalesce(\n qualifying_procedures.procedure_date\n , qualifying_claims.claim_start_date\n , qualifying_claims.claim_end_date\n ) as evidence_date\n , case\n when qualifying_claims.claim_start_date >= denominator.performance_period_begin\n or qualifying_claims.claim_end_date <= denominator.performance_period_end\n then 1\n when qualifying_procedures.procedure_date >= denominator.performance_period_begin\n or qualifying_procedures.procedure_date <= 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_procedures\n on denominator.patient_id = qualifying_procedures.patient_id\n\n)\n\n, numerator as (\n\n select distinct\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 patients_with_mammograms\n\n)\n\n, add_data_types as (\n\n select\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 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 , numerator_flag\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "sql": " __dbt__cte__quality_measures_reporting__stg_medical_claim as (\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 , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures_reporting__stg_core__condition": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__condition.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__condition.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "staging", "quality_measures_reporting__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "d5b9ffb3a1985adb20e80a9cfb250d45b2f99184e97bf052b35199b5f7b3d310"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Date in which the condition occured.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_stg_condition", "tags": "quality_measures_reporting", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1693946733.1185253, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , claim_id\r\n , recorded_date as condition_date\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": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__stg_core__patient": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__patient.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__patient.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "staging", "quality_measures_reporting__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "867e42b4df135db8c797744f67c62790b814248ddefc6108ebcdc1e233c18863"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_stg_patient", "tags": "quality_measures_reporting", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1693946733.123191, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex as gender\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": [["core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__stg_core__procedure": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__procedure.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "staging", "quality_measures_reporting__stg_core__procedure"], "alias": "_stg_procedure", "checksum": {"name": "sha256", "checksum": "1af00b06b7c4e0feb81e9db386878804f369c3b2cdc50daa7fe733597391e8ec"}, "config": {"enabled": true, "alias": "_stg_procedure", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_stg_procedure", "tags": "quality_measures_reporting", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1693946733.126247, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , procedure_date\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__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_core__procedure.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__stg_medical_claim": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_medical_claim.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "staging", "quality_measures_reporting__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "31da67d103bc84c90e4049c8608347148ee61731b2cd7839344b84357f3c208b"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Staging medical claims from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "Place of service for the claim (professional claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_stg_medical_claim", "tags": "quality_measures_reporting", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1693946733.132769, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\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('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_medical_claim.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_pharmacy_claim.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "staging", "quality_measures_reporting__stg_pharmacy_claim"], "alias": "_stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "363442c0fb29d8093efc6851cf31a430bcb7a6a0c94f67bd259c2d1b67278d0f"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Staging pharmacy claims from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_update": {"name": "last_update", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_stg_pharmacy_claim", "tags": "quality_measures_reporting", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1693946733.1367652, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\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('pharmacy_claim') }}", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\staging\\quality_measures_reporting__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "tuva", "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": "1e008007367bfa606c545d2f9b247c49fe42009d71bb535307b87927c41a9892"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "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", "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", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\final\\readmissions__encounter_augmented.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "encounter_augmented", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.1635034, "relation_name": "tuva.readmissions.encounter_augmented", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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.total_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.multiple_primary_diagnoses_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": [["readmissions__encounter"], ["readmissions__index_admission"], ["readmissions__planned_encounter"], ["readmissions__encounter_specialty_cohort"], ["readmissions__encounter_data_quality"]], "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.total_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.multiple_primary_diagnoses_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 '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom\n tuva.readmissions._int_encounter aa\n left join tuva.readmissions._int_index_admission bb\n on aa.encounter_id = bb.encounter_id\n left join tuva.readmissions._int_planned_encounter cc\n on aa.encounter_id = cc.encounter_id \n left join tuva.readmissions._int_encounter_specialty_cohort dd\n on aa.encounter_id = dd.encounter_id\n left join tuva.readmissions._int_encounter_data_quality ee\n on aa.encounter_id = ee.encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__readmission_summary": {"database": "tuva", "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": "8e856a742039f7904dcb3753683a0de320d01723cd587184551051ed3f20a318"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "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", "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", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "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", "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", "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", "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", "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "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": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "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", "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", "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "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", "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\final\\readmissions__readmission_summary.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "readmission_summary", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.177599, "relation_name": "tuva.readmissions.readmission_summary", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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.total_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": [["readmissions__encounter_augmented"]], "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 tuva.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.total_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 '2023-09-05 20:45:28.914033+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": []}, "model.the_tuva_project.readmissions__diagnosis": {"database": "tuva", "schema": "readmissions", "name": "readmissions__diagnosis", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__diagnosis.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__diagnosis.sql", "unique_id": "model.the_tuva_project.readmissions__diagnosis", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__diagnosis"], "alias": "_int_stg_diagnosis", "checksum": {"name": "sha256", "checksum": "6616afb445f138247baa4d5238083b78ecf192b1483d27a473f6d78d4d14cda9"}, "config": {"enabled": true, "alias": "_int_stg_diagnosis", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique diagnosis a patient got in an encouter. All diagnoses available in the input data set are present here.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__diagnosis.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_stg_diagnosis", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.2193575, "relation_name": "tuva.readmissions._int_stg_diagnosis", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Staging model for the input layer:\r\n-- stg_diagnosis input layer model.\r\n-- This contains one row for every unique diagnosis each patient has.\r\n\r\nselect distinct\r\n cast(a.encounter_id as {{ dbt.type_string() }}) as encounter_id\r\n, cast(a.normalized_code as {{ dbt.type_string() }}) as diagnosis_code\r\n, cast(a.condition_rank as integer) as diagnosis_rank\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__condition') }} a\r\ninner join {{ ref('readmissions__stg_core__encounter') }} b\r\n on a.encounter_id = b.encounter_id\r\nwhere normalized_code_type = 'icd-10-cm'", "language": "sql", "refs": [["readmissions__stg_core__condition"], ["readmissions__stg_core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__diagnosis.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__condition as (\n\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n), __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 as total_paid_amount,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)-- Staging model for the input layer:\n-- stg_diagnosis input layer model.\n-- This contains one row for every unique diagnosis each patient has.\n\nselect distinct\n cast(a.encounter_id as TEXT) as encounter_id\n, cast(a.normalized_code as TEXT) as diagnosis_code\n, cast(a.condition_rank as integer) as diagnosis_rank\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom __dbt__cte__readmissions__stg_core__condition a\ninner join __dbt__cte__readmissions__stg_core__encounter b\n on a.encounter_id = b.encounter_id\nwhere normalized_code_type = 'icd-10-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__condition", "sql": " __dbt__cte__readmissions__stg_core__condition as (\n\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}, {"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 as total_paid_amount,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}]}, "model.the_tuva_project.readmissions__diagnosis_ccs": {"database": "tuva", "schema": "readmissions", "name": "readmissions__diagnosis_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__diagnosis_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__diagnosis_ccs"], "alias": "_int_diagnosis_ccs", "checksum": {"name": "sha256", "checksum": "244ef52041a36c41a42e70b4634f837ad5962cdba7cb6b29b85e6e1130dcd0bf"}, "config": {"enabled": true, "alias": "_int_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounter_ids from the stg_diagnosis table that have one and only one primary diagnosis code associated with them. There is one row for each of these encounters, namely, the row corresponding to the unique primary diagnosis code of the encounter. Therefore, the number of rows in this model is equal to the number of encounter_ids in the stg_diagnosis model that have one and only one primary diagnosis code. We add a valid_icd_10_cm_flag to indicate if the primary diagnosis code for the encounter is a valid ICD-10-CM code. We also add the CCS diagnosis category associated with the primary diagnosis code of the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "valid_icd_10_cm_flag": {"name": "valid_icd_10_cm_flag", "description": "A flag indicating if the ICD-10-CM diagnosis code given is valid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccs_diagnosis_category": {"name": "ccs_diagnosis_category", "description": "The CCS code associated with the given ICD-10-CM diagnosis", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_diagnosis_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.180608, "relation_name": "tuva.readmissions._int_diagnosis_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we take all rows from the stg_diagnosis\r\n-- table that correspond to encounters with\r\n-- one and only one primary diagnosis code.\r\n-- To each of these rows we also append:\r\n--\r\n-- - a 'valid_icd_10_cm_flag' to verify if it is a\r\n-- valid ICD-10-CM code\r\n--\r\n-- - a 'ccs_diagnosis_category' column to indicate\r\n-- the associated diagnosis category\r\n--\r\n-- encounter_ids that have no primary diagnosis or\r\n-- multiple primary diagnoses are not part of this model\r\n-- because it is impossible to assign a ccs_diagnosis_category\r\n-- to them. In theory, each encounter should have a unique\r\n-- ccs_diagnosis_category that is determined by their unique\r\n-- primary diagnosis ICD-10-CM code.\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.diagnosis_code,\r\n aa.diagnosis_rank,\r\n case\r\n when bb.icd_10_cm is null then 0\r\n\telse 1\r\n end as valid_icd_10_cm_flag,\r\n cc.ccs_diagnosis_category,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__diagnosis') }} aa\r\n left join {{ ref('terminology__icd_10_cm') }} bb\r\n on aa.diagnosis_code = bb.icd_10_cm\r\n left join {{ ref('readmissions__icd_10_cm_to_ccs') }} cc\r\n on aa.diagnosis_code = cc.icd_10_cm\r\n left join {{ ref('readmissions__primary_diagnosis_count') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n\r\nwhere\r\n aa.diagnosis_rank = 1\r\n and\r\n dd.primary_dx_count = 1", "language": "sql", "refs": [["readmissions__diagnosis"], ["terminology__icd_10_cm"], ["readmissions__icd_10_cm_to_ccs"], ["readmissions__primary_diagnosis_count"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__diagnosis", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "model.the_tuva_project.readmissions__primary_diagnosis_count"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "compiled": true, "compiled_code": "\n\n-- Here we take all rows from the stg_diagnosis\n-- table that correspond to encounters with\n-- one and only one primary diagnosis code.\n-- To each of these rows we also append:\n--\n-- - a 'valid_icd_10_cm_flag' to verify if it is a\n-- valid ICD-10-CM code\n--\n-- - a 'ccs_diagnosis_category' column to indicate\n-- the associated diagnosis category\n--\n-- encounter_ids that have no primary diagnosis or\n-- multiple primary diagnoses are not part of this model\n-- because it is impossible to assign a ccs_diagnosis_category\n-- to them. In theory, each encounter should have a unique\n-- ccs_diagnosis_category that is determined by their unique\n-- primary diagnosis ICD-10-CM code.\n\nselect\n aa.encounter_id,\n aa.diagnosis_code,\n aa.diagnosis_rank,\n case\n when bb.icd_10_cm is null then 0\n\telse 1\n end as valid_icd_10_cm_flag,\n cc.ccs_diagnosis_category,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom\n tuva.readmissions._int_stg_diagnosis aa\n left join tuva.terminology.icd_10_cm bb\n on aa.diagnosis_code = bb.icd_10_cm\n left join tuva.readmissions._value_set_icd_10_cm_to_ccs cc\n on aa.diagnosis_code = cc.icd_10_cm\n left join tuva.readmissions._int_primary_diagnosis_count dd\n on aa.encounter_id = dd.encounter_id\n\nwhere\n aa.diagnosis_rank = 1\n and\n dd.primary_dx_count = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter": {"database": "tuva", "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": "aa68e7c72b20c7929afca07dad5a220b2c68589dc0ab4f407317cc48ce38eec8"}, "config": {"enabled": true, "alias": "_int_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.2223794, "relation_name": "tuva.readmissions._int_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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(total_paid_amount as numeric) as total_paid_amount,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__encounter') }}", "language": "sql", "refs": [["readmissions__stg_core__encounter"]], "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 as total_paid_amount,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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(total_paid_amount as numeric) as total_paid_amount,\n '2023-09-05 20:45:28.914033+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 as total_paid_amount,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}]}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "tuva", "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": "5afef6c46f8677e7271149154a2821045d9845f2a75b0bb70243dde5ccc71422"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_data_quality", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.1865876, "relation_name": "tuva.readmissions._int_encounter_data_quality", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 (cc.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 ( (dd.primary_dx_count is null)\r\n\t or\r\n\t (dd.primary_dx_count = 0)\r\n\t\tor\r\n\t\t(dd.primary_dx_count = 1 and bb.diagnosis_code is null) )\r\n\t then 1\r\n\telse 0\r\n end as missing_primary_diagnosis_flag,\r\n case\r\n when dd.primary_dx_count > 1 then 1\r\n\telse 0\r\n end as multiple_primary_diagnoses_flag,\r\n case\r\n when bb.valid_icd_10_cm_flag = 0 then 1\r\n\telse 0\r\n end as invalid_primary_diagnosis_code_flag,\r\n case\r\n when ( bb.valid_icd_10_cm_flag = 1\r\n\t and\r\n\t bb.ccs_diagnosis_category is null )\r\n then 1\r\n\telse 0\r\n end as no_diagnosis_ccs_flag,\r\n bb.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 ee.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') }} aa\r\n left join {{ ref('readmissions__diagnosis_ccs') }} bb\r\n on aa.encounter_id = bb.encounter_id\r\n left join {{ ref('terminology__discharge_disposition') }} cc\r\n on aa.discharge_disposition_code = cc.discharge_disposition_code\r\n left join {{ ref('readmissions__primary_diagnosis_count') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n left join {{ ref('terminology__ms_drg') }} ee\r\n on aa.ms_drg_code = ee.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 (multiple_primary_diagnoses_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 multiple_primary_diagnoses_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": [["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"], ["readmissions__encounter"], ["readmissions__diagnosis_ccs"], ["terminology__discharge_disposition"], ["readmissions__primary_diagnosis_count"], ["terminology__ms_drg"]], "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", "model.the_tuva_project.readmissions__diagnosis_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "model.the_tuva_project.readmissions__primary_diagnosis_count", "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 (cc.discharge_disposition_code is null) then 1\n\telse 0\n end as invalid_discharge_disposition_code_flag,\n case\n when ( (dd.primary_dx_count is null)\n\t or\n\t (dd.primary_dx_count = 0)\n\t\tor\n\t\t(dd.primary_dx_count = 1 and bb.diagnosis_code is null) )\n\t then 1\n\telse 0\n end as missing_primary_diagnosis_flag,\n case\n when dd.primary_dx_count > 1 then 1\n\telse 0\n end as multiple_primary_diagnoses_flag,\n case\n when bb.valid_icd_10_cm_flag = 0 then 1\n\telse 0\n end as invalid_primary_diagnosis_code_flag,\n case\n when ( bb.valid_icd_10_cm_flag = 1\n\t and\n\t bb.ccs_diagnosis_category is null )\n then 1\n\telse 0\n end as no_diagnosis_ccs_flag,\n bb.ccs_diagnosis_category as diagnosis_ccs,\n case\n when aa.encounter_id in (select distinct encounter_id_A\n\t from tuva.readmissions._int_encounter_overlap )\n\t or\n\t aa.encounter_id in (select distinct encounter_id_B\n\t from tuva.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 ee.ms_drg_code is null then 1\n\telse 0\n end as invalid_ms_drg_flag\n\nfrom tuva.readmissions._int_encounter aa\n left join tuva.readmissions._int_diagnosis_ccs bb\n on aa.encounter_id = bb.encounter_id\n left join tuva.terminology.discharge_disposition cc\n on aa.discharge_disposition_code = cc.discharge_disposition_code\n left join tuva.readmissions._int_primary_diagnosis_count dd\n on aa.encounter_id = dd.encounter_id\n left join tuva.terminology.ms_drg ee\n on aa.ms_drg_code = ee.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 (multiple_primary_diagnoses_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 multiple_primary_diagnoses_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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "tuva", "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": "b84bceb51ad086d73b05fb665e30acab90f60dc47f5061ebaf0fcae37d304ae8"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_overlap", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.1908283, "relation_name": "tuva.readmissions._int_encounter_overlap", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"]], "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 tuva.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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "tuva", "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": "9f686a372bb3c4705326b2c938583d552e43801622d7116618b5cf89b99de6dd"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_specialty_cohort", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.1938136, "relation_name": "tuva.readmissions._int_encounter_specialty_cohort", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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__diagnosis_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": [["readmissions__procedure_ccs"], ["readmissions__surgery_gynecology_cohort"], ["readmissions__specialty_cohort"], ["readmissions__diagnosis_ccs"], ["readmissions__specialty_cohort"], ["readmissions__encounter"]], "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__diagnosis_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 tuva.readmissions._int_procedure_ccs proc\n left join tuva.readmissions._value_set_surgery_gynecology_cohort sgc\n on proc.procedure_code = sgc.icd_10_pcs\n left join tuva.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 tuva.readmissions._int_diagnosis_ccs diag\n inner join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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": []}, "model.the_tuva_project.readmissions__exclusion": {"database": "tuva", "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": "699d6d6e6f8d44a297493f19e07c12db60014158a6c8b7d7272512e891425039"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__exclusion.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_exclusion", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.1968036, "relation_name": "tuva.readmissions._int_exclusion", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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__diagnosis_ccs') }}\r\nwhere ccs_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\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [["readmissions__diagnosis_ccs"], ["readmissions__exclusion_ccs_diagnosis_category"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__diagnosis_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 tuva.readmissions._int_diagnosis_ccs\nwhere ccs_diagnosis_category in\n (select distinct ccs_diagnosis_category\n from tuva.readmissions._value_set_exclusion_ccs_diagnosis_category )\n)\n\n\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_admission": {"database": "tuva", "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": "2d34ec9441371c8651597177e538b27be84fcfd5cf5742a65e64811197a4adda"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_admission.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_admission", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.1993456, "relation_name": "tuva.readmissions._int_index_admission", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__index_time_requirement"], ["readmissions__index_discharge_requirement"], ["readmissions__exclusion"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.readmissions._int_encounter a\ninner join tuva.readmissions._int_index_time_requirement b\n on a.encounter_id = b.encounter_id\ninner join tuva.readmissions._int_index_discharge_requirement c\n on a.encounter_id = c.encounter_id\nleft join tuva.readmissions._int_exclusion d\n on a.encounter_id = d.encounter_id\nwhere d.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"database": "tuva", "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": "800e7d266ced014025155d3c9d584849fc5132e54382aa7572e7b1fb863f6f23"}, "config": {"enabled": true, "alias": "_int_index_discharge_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_discharge_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.2013345, "relation_name": "tuva.readmissions._int_index_discharge_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__encounter"]], "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 tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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": []}, "model.the_tuva_project.readmissions__index_time_requirement": {"database": "tuva", "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": "f85ec812e7ed57b593ad387b55dae487f29c2c9f9dbb340944f965d134e4b147"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_time_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.204325, "relation_name": "tuva.readmissions._int_index_time_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__encounter"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.readmissions._int_encounter\nwhere discharge_date <= (select max(discharge_date)\n from tuva.readmissions._int_encounter ) - 30", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__planned_encounter": {"database": "tuva", "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": "7ba861de4973a8f85cc4248f072b7fbb2a775166b9b831c53c3a62c35df5c729"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__planned_encounter.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_planned_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.2074943, "relation_name": "tuva.readmissions._int_planned_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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__diagnosis_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__diagnosis_ccs') }} dccs\r\nleft join {{ ref('readmissions__acute_diagnosis_icd_10_cm') }} adi\r\n on dccs.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": [["readmissions__procedure_ccs"], ["readmissions__always_planned_ccs_procedure_category"], ["readmissions__diagnosis_ccs"], ["readmissions__always_planned_ccs_diagnosis_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_ccs_procedure_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_icd_10_pcs"], ["readmissions__diagnosis_ccs"], ["readmissions__acute_diagnosis_icd_10_cm"], ["readmissions__acute_diagnosis_ccs"]], "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__diagnosis_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__diagnosis_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 tuva.readmissions._int_procedure_ccs pccs\ninner join tuva.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 tuva.readmissions._int_diagnosis_ccs dccs\ninner join tuva.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 tuva.readmissions._int_procedure_ccs pccs\ninner join tuva.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 tuva.readmissions._int_procedure_ccs pcs\ninner join tuva.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 tuva.readmissions._int_diagnosis_ccs dccs\nleft join tuva.readmissions._value_set_acute_diagnosis_icd_10_cm adi\n on dccs.diagnosis_code = adi.icd_10_cm\nleft join tuva.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 * , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__primary_diagnosis_count": {"database": "tuva", "schema": "readmissions", "name": "readmissions__primary_diagnosis_count", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "unique_id": "model.the_tuva_project.readmissions__primary_diagnosis_count", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__primary_diagnosis_count"], "alias": "_int_primary_diagnosis_count", "checksum": {"name": "sha256", "checksum": "7486544ed5290774b78ca5b30f13ef83788bad5b13136154a77dfcb6c5bc26c6"}, "config": {"enabled": true, "alias": "_int_primary_diagnosis_count", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes a count of primary diagnoses related to each encounter_id in the stg_diagnosis model. In theory, each encounter_id should only have a single primary diagnosis, but this model checks how many primary diagnoses each encounter_id has in the dataset.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_dx_count": {"name": "primary_dx_count", "description": "A positive integer giving the count of primary diagnoses for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_primary_diagnosis_count", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.20853, "relation_name": "tuva.readmissions._int_primary_diagnosis_count", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Every encounter should have one and only one primary\r\n-- diagnosis. A potential data quality problem would\r\n-- be to have encounters that have no primary diagnosis\r\n-- or multiple primary diagnoses.\r\n-- Here we list the count of primary diagnoses associated\r\n-- with each encounter in the stg_diagnosis model.\r\n\r\n\r\n\r\n-- Here we list the primary diagnosis count for every\r\n-- encounter_id in the stg_diagnosis model that has\r\n-- at least one primary diagnosis\r\nwith primary_diagnosis_count_greater_than_zero as (\r\nselect\r\n encounter_id,\r\n count(*) as primary_dx_count\r\nfrom {{ ref('readmissions__diagnosis') }}\r\nwhere diagnosis_rank = 1\r\ngroup by encounter_id\r\n),\r\n\r\n\r\n-- Here we list all distinct encounter_ids in the\r\n-- stg_diagnosis model\r\nall_encounter_ids as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__diagnosis') }}\r\n),\r\n\r\n\r\n-- Here we list the primary diagnosis count for every\r\n-- encounter_id in the stg_diagnosis model.\r\n-- The primary_dx_count can be any\r\n-- nonnegative integer: {0,1,2,3,...}\r\nall_primary_diagnosis_count as (\r\nselect\r\n aa.encounter_id,\r\n case\r\n when bb.primary_dx_count is null then 0\r\n\telse bb.primary_dx_count\r\n end as primary_dx_count\r\nfrom\r\n all_encounter_ids aa\r\n left join primary_diagnosis_count_greater_than_zero bb\r\n on aa.encounter_id = bb.encounter_id\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_primary_diagnosis_count", "language": "sql", "refs": [["readmissions__diagnosis"], ["readmissions__diagnosis"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__diagnosis"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "compiled": true, "compiled_code": "\n\n-- Every encounter should have one and only one primary\n-- diagnosis. A potential data quality problem would\n-- be to have encounters that have no primary diagnosis\n-- or multiple primary diagnoses.\n-- Here we list the count of primary diagnoses associated\n-- with each encounter in the stg_diagnosis model.\n\n\n\n-- Here we list the primary diagnosis count for every\n-- encounter_id in the stg_diagnosis model that has\n-- at least one primary diagnosis\nwith primary_diagnosis_count_greater_than_zero as (\nselect\n encounter_id,\n count(*) as primary_dx_count\nfrom tuva.readmissions._int_stg_diagnosis\nwhere diagnosis_rank = 1\ngroup by encounter_id\n),\n\n\n-- Here we list all distinct encounter_ids in the\n-- stg_diagnosis model\nall_encounter_ids as (\nselect distinct encounter_id\nfrom tuva.readmissions._int_stg_diagnosis\n),\n\n\n-- Here we list the primary diagnosis count for every\n-- encounter_id in the stg_diagnosis model.\n-- The primary_dx_count can be any\n-- nonnegative integer: {0,1,2,3,...}\nall_primary_diagnosis_count as (\nselect\n aa.encounter_id,\n case\n when bb.primary_dx_count is null then 0\n\telse bb.primary_dx_count\n end as primary_dx_count\nfrom\n all_encounter_ids aa\n left join primary_diagnosis_count_greater_than_zero bb\n on aa.encounter_id = bb.encounter_id\n)\n\n\n\nselect *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom all_primary_diagnosis_count", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "tuva", "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": "84584613e857ed1c5b88902cab3635d8ebcd675344e78c6df5c75f3fa5eb4770"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_procedure_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.20853, "relation_name": "tuva.readmissions._int_procedure_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__stg_core__procedure"], ["terminology__icd_10_pcs"], ["readmissions__icd_10_pcs_to_ccs"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.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 '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom\n __dbt__cte__readmissions__stg_core__procedure aa\n left join tuva.terminology.icd_10_pcs bb\n on aa.normalized_code = bb.icd_10_pcs\n left join tuva.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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.readmissions__readmission_crude": {"database": "tuva", "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": "ac2709cae4a94c2e2e39a9e89d09dc4276c15c3e2cc2f4813115339c7baf2179"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": "../target\\run\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_readmission_crude", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.2177906, "relation_name": "tuva.readmissions._int_readmission_crude", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"]], "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 tuva.readmissions._int_encounter enc\nleft join tuva.readmissions._int_encounter_overlap over_a\n on enc.encounter_id = over_a.encounter_id_A\nleft join tuva.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 *, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "c4705cc9d628122f8458f631a8ab9c76cec94cc2786a756fa9b3750eec3ab2b1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1693946733.2274225, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["core__condition"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "tuva", "schema": "claims_data_model", "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": "c65f5c6f52afbf8a21fa3c043db1ebc4a5cc373ca2e891300bc17cddfef237f3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1693946733.2284503, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 as total_paid_amount,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\nwhere encounter_type = 'acute inpatient'", "language": "sql", "refs": [["core__encounter"]], "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 as total_paid_amount,\n '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__medical_claim": {"database": "tuva", "schema": "claims_data_model", "name": "readmissions__stg_core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__medical_claim", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__medical_claim"], "alias": "readmissions__stg_core__medical_claim", "checksum": {"name": "sha256", "checksum": "6a5a89e6c24a55d72a531de9174a952f3ef9174b321ef6edd85dd5dee5df1858"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1693946733.2284503, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\r\n, encounter_id\r\n, encounter_type\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, encounter_id\n, encounter_type\n, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "tuva", "schema": "claims_data_model", "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": "d0ef7f22c43c889710e61c50fecd24d9b9e18a212bfeb6bfc755ee6cc96f3eb4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1693946733.232495, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["core__procedure"]], "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, '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": {"database": "tuva", "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": "365a11f6c2dd3d55cd23af732ea2fc555d6decb29e2087a79646c8e048a28492"}, "config": {"enabled": true, "alias": "patient_risk_factors_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\snapshots\\cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "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": true}, "created_at": 1693946731.8473396, "relation_name": "tuva.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('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n", "language": "sql", "refs": [["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_factors"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\n\n\nselect * from tuva.cms_hcc.patient_risk_factors\n", "extra_ctes_injected": true, "extra_ctes": []}, "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": {"database": "tuva", "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": "7eb3451462fca7a97e24a7d6ae24719e1e57850ea1da3d61d2f74f73506819bb"}, "config": {"enabled": true, "alias": "patient_risk_scores_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\snapshots\\cms_hcc\\cms_hcc__patient_risk_scores_snapshot.sql", "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||model_version||payment_year||tuva_last_run", "enabled": true}, "created_at": 1693946731.8535032, "relation_name": "tuva.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||model_version||payment_year||tuva_last_run\"\r\n , \"enabled\": var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_scores') }}\r\n\r\n", "language": "sql", "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\n\n\nselect * from tuva.cms_hcc.patient_risk_scores\n", "extra_ctes_injected": true, "extra_ctes": []}, "seed.the_tuva_project.terminology__admit_source": {"database": "tuva", "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": "52cfafd223b8a134e28057eafb78f93e53f119156fa9ef6603ca372266a6e4c5"}, "config": {"enabled": true, "alias": "admit_source", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__admit_source.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.2375126, "relation_name": "tuva.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__admit_type": {"database": "tuva", "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": "3346cb56b5216d56f0a7f4260e1e85f9fb83697e5020cbcfc198da65edaeb449"}, "config": {"enabled": true, "alias": "admit_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__admit_type.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "admit_type", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.2400546, "relation_name": "tuva.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ansi_fips_state": {"database": "tuva", "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": "e4137e40ea8d3ff1bdfb3c661f898d05f0b71f7b5f46ef7ad38ad176e2d306a0"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__ansi_fips_state.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.2826834, "relation_name": "tuva.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__apr_drg": {"database": "tuva", "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": "7644458580dcc94c2982457f23b2510997e68249783c1bd9132d9c748066e8bc"}, "config": {"enabled": true, "alias": "apr_drg", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__apr_drg.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "apr_drg", "tags": ["terminology", "data_profiling"], "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.4038274, "relation_name": "tuva.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__bill_type": {"database": "tuva", "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": "df4c7c4855d7aeb9f06f1595d00b58a26292a667c2394924c41b791982f575e5"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__bill_type.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.247636, "relation_name": "tuva.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__calendar": {"database": "tuva", "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": "cd7f87880a1e1f0c4e098ef6584cdd711d3431b331054ac9bc61bcd1f52ee52b"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','calendar.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__calendar.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','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": "#460d4f"}}, "created_at": 1693946733.2554612, "relation_name": "tuva.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "bce5496f01c098e7707ae90a5d30e622ede0cc119b80898881b79217a6e36ba1"}, "config": {"enabled": true, "alias": "claim_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__claim_type.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "claim_type", "tags": ["terminology", "data_profiling"], "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.2588136, "relation_name": "tuva.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__code_type": {"database": "tuva", "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": "d99b5d1f18b130e99e1c1f80f9fe83a7f7e09f311e19327d07ba840941a983cb"}, "config": {"enabled": true, "alias": "code_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__code_type.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "code_type", "tags": ["terminology", "data_profiling"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.259823, "relation_name": "tuva.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__discharge_disposition": {"database": "tuva", "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": "102f68b0e0d114d517f8896164e534ec4623b500519bcb427952573b721e374e"}, "config": {"enabled": true, "alias": "discharge_disposition", "schema": "terminology", "database": null, "tags": [], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__discharge_disposition.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "discharge_disposition", "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.259823, "relation_name": "tuva.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__encounter_type": {"database": "tuva", "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": "b823346a3c0ff0288107da5f53bee8064bc61bbff3a44a0642574a9cc1cd47ea"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__encounter_type.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "encounter_type", "tags": ["terminology", "claims_preprocessing"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.269353, "relation_name": "tuva.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ethnicity": {"database": "tuva", "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": "2756d8fc5cb0632232b61ec93564639f42b79cc58080e58802defdc2f08beb49"}, "config": {"enabled": true, "alias": "ethnicity", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__ethnicity.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ethnicity", "tags": "terminology", "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.273508, "relation_name": "tuva.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__fips_county": {"database": "tuva", "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": "39792877b3b9ef63bd80b51db7f7afc5758ce61266837e5fcf60eac5d902b97b"}, "config": {"enabled": true, "alias": "fips_county", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__fips_county.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "fips_county", "tags": "terminology", "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.2785025, "relation_name": "tuva.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__gender": {"database": "tuva", "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": "643b3aba4aed1f3d91f07e343e90360ba91f3ac33994fe2fbe3c7681510cdcbb"}, "config": {"enabled": true, "alias": "gender", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__gender.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "gender", "tags": ["terminology", "data_profiling"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.2876651, "relation_name": "tuva.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"database": "tuva", "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": "path", "checksum": "seeds\\terminology\\terminology__hcpcs_level_2.csv"}, "config": {"enabled": true, "alias": "hcpcs_level_2", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__hcpcs_level_2.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.2940366, "relation_name": "tuva.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__icd_10_cm": {"database": "tuva", "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": "08903dd5b951cfdd2dc1e2d92406571ab08c2fa401c2f951a6190b38af1dbf61"}, "config": {"enabled": true, "alias": "icd_10_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','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": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__icd_10_cm.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','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", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.301187, "relation_name": "tuva.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "f17eb0d946b77499e0fb9196e1993dc4e6212b8932f0b7bea054be5ba13ce50e"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__icd_10_pcs.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','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": "#460d4f"}}, "created_at": 1693946733.3081832, "relation_name": "tuva.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "path", "checksum": "seeds\\terminology\\terminology__icd_9_cm.csv"}, "config": {"enabled": true, "alias": "icd_9_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__icd_9_cm.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.3131804, "relation_name": "tuva.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__icd_9_pcs": {"database": "tuva", "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": "dc97df38ffbff5dddcd6e0160d41f76c3d29b7d740b583faaac1a5de86698fab"}, "config": {"enabled": true, "alias": "icd_9_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__icd_9_pcs.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.3247344, "relation_name": "tuva.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__mdc": {"database": "tuva", "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": "478273d43b2a5da8f36fb12d6b89a8e64e90fb85a44b8c34e4f607b1bb78dfe5"}, "config": {"enabled": true, "alias": "mdc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__mdc.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "mdc", "tags": "terminology", "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.3282473, "relation_name": "tuva.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"database": "tuva", "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": "0129d0377cfb0a7510cd8e0270f9f835a5ade1bca963479a86076cd1828de709"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__medicare_dual_eligibility.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.3345795, "relation_name": "tuva.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_status": {"database": "tuva", "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": "a303d26035b0a620409823260cf237836aebda917c5f80706a4f84c6664ef151"}, "config": {"enabled": true, "alias": "medicare_status", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__medicare_status.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "medicare_status", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.3427987, "relation_name": "tuva.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ms_drg": {"database": "tuva", "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": "e5b574ab858ae97a820046cf42c3068c45e25457ab3ddcbdbc7e22281a386941"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__ms_drg.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.3494735, "relation_name": "tuva.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"database": "tuva", "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": {}, "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": "#460d4f"}, "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": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__other_provider_taxonomy.csv", "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": "#460d4f"}}, "created_at": 1693946733.3575814, "relation_name": "tuva.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "84ad06d9900eba3d6ccf8e462df196e9d2499fe0cb08882eb5f67323dc8ba33a"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__payer_type.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "payer_type", "tags": ["terminology", "data_profiling"], "column_types": {"payer_type": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.3638895, "relation_name": "tuva.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__place_of_service": {"database": "tuva", "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": "7ac7b69c217edab985ea2e1a59113093fe90fc6890af052d71b5a4cfd12ce180"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__place_of_service.csv", "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1693946733.3705776, "relation_name": "tuva.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__present_on_admission": {"database": "tuva", "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": "58c7c47c9822c23c7a0518bcef0d10794e5c29d0cf3d98f141e70fd7a73f480d"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__present_on_admission.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "present_on_admission", "tags": ["terminology", "data_profiling", "claims_preprocessing"], "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.375102, "relation_name": "tuva.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__provider": {"database": "tuva", "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": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','provider.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__provider.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/provider_data','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": "#460d4f"}}, "created_at": 1693946733.3908217, "relation_name": "tuva.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "cd381b8fbf1fdedfdbb3f28f961c5eb763d3f4bb9088d4426c91f93f60e4dd34"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"race_code": "varchar", "race_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__race.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "race", "tags": ["terminology", "data_profiling"], "column_types": {"race_code": "varchar", "race_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.3948085, "relation_name": "tuva.terminology.race", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__revenue_center": {"database": "tuva", "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": "3c650ef496d7ec010eec2543da454ad31dba96452753b48981252de68d72ba65"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__revenue_center.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "revenue_center", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.399807, "relation_name": "tuva.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ssa_fips_state": {"database": "tuva", "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": "39debce4523ac23a14548c046752a7d7b70b7877f8bce5ec94a07de1a6788286"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\terminology\\terminology__ssa_fips_state.csv", "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ssa_fips_state", "tags": "terminology", "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1693946733.338217, "relation_name": "tuva.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "tuva", "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": "dd8b64d00c38d7a99174fa8d2b6b82f2eae2b039e7ef0cd00da36d3233d6b326"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_body_systems", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_body_systems", "tags": ["ccsr"], "enabled": true}, "created_at": 1693946733.432199, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"database": "tuva", "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": {}, "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": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','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"}}, "created_at": 1693946733.4212086, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "e26501963b41e323fcebadca74e051da890db7c264e0c0bbdc906862bc600a84"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "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": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','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"}}, "created_at": 1693946733.4293065, "relation_name": "tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "path", "checksum": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "config": {"enabled": true, "alias": "_value_set_cms_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "CMS generated grouping of ICD 10 codes into chronic conditions groups", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\cms_chronic_conditions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_value_set_cms_chronic_conditions_hierarchy", "tags": ["cms_chronic_conditions", "chronic_conditions"], "enabled": true, "docs": {"node_color": "#804912"}}, "created_at": 1693946733.4361856, "relation_name": "tuva.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"database": "tuva", "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": "15ce75a34050c084ac8f8cfa265f100db069114a3dd0f9a55c8db01150733453"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "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": {"condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up into", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_description": {"name": "icd_10_cm_description", "description": "The description for the icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_column_name": {"name": "condition_column_name", "description": "The name of the column as it will appear in chronic_conditions_wide", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\tuva_chronic_conditions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_value_set_tuva_chronic_conditions_hierarchy", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "enabled": true, "docs": {"node_color": "#804912"}}, "created_at": 1693946733.4406989, "relation_name": "tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"database": "tuva", "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": "8cb085133b926383e2030fd987d3023588b57a90f8b8e87a20e6a289ca58f0ac"}, "config": {"enabled": true, "alias": "_value_set_adjustment_rates", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Adjustment rates by payment year. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_adjustment_rates", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1693946733.443689, "relation_name": "tuva.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"database": "tuva", "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": "4734b5b9047622e7d95f6b220e392afb8b80d53aa9b8be52785d050cd2adb835"}, "config": {"enabled": true, "alias": "_value_set_cpt_hcpcs", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "deferred": false, "unrendered_config": {"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"}}, "created_at": 1693946733.449367, "relation_name": "tuva.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"database": "tuva", "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": "8f0d031051368f019fcb9b42986eb2b83f55e3c0f50b4b622ccb33052c170971"}, "config": {"enabled": true, "alias": "_value_set_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__demographic_factors.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_demographic_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1693946733.4537594, "relation_name": "tuva.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"database": "tuva", "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": "10ecd34b010e98de03921020bab64f1221645289533b40b691ed3e73049d8e76"}, "config": {"enabled": true, "alias": "_value_set_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__disabled_interaction_factors.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disabled_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "coefficient": "float"}}, "created_at": 1693946733.4583654, "relation_name": "tuva.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_factors": {"database": "tuva", "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": "76d0db09692f13952544adbc6b27647967b5606d4a6a7afca91627fe41dffe53"}, "config": {"enabled": true, "alias": "_value_set_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__disease_factors.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "coefficient": "float"}}, "created_at": 1693946733.461924, "relation_name": "tuva.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"database": "tuva", "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": "0c8832760b5a65fcd7dbb31550cc6ade98bfd4293427911cb13ac7960c541734"}, "config": {"enabled": true, "alias": "_value_set_disease_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "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"}}, "created_at": 1693946733.4695218, "relation_name": "tuva.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "tuva", "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": "3c939b7a8df5d3330c4cf935d068839119019553beb2438dab0baf2b466f0478"}, "config": {"enabled": true, "alias": "_value_set_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"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": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__disease_interaction_factors.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}}, "created_at": 1693946733.474037, "relation_name": "tuva.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"database": "tuva", "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": "6e29ef73efbce47b7dab2ec4e6ce5d521d35d83f14a0f1f130329aab8948492c"}, "config": {"enabled": true, "alias": "_value_set_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__enrollment_interaction_factors.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_enrollment_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1693946733.477547, "relation_name": "tuva.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"database": "tuva", "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": "path", "checksum": "seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "deferred": false, "unrendered_config": {"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"}}, "created_at": 1693946733.485065, "relation_name": "tuva.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"database": "tuva", "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": "37d33e7a0bb8ad97f5bd24132f2e8a5af2deb11b1ce0acf07bc1bab822ecd98c"}, "config": {"enabled": true, "alias": "_value_set_payment_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_payment_hcc_count_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1693946733.4906206, "relation_name": "tuva.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.data_profiling__test_catalog": {"database": "tuva", "schema": "data_profiling", "name": "data_profiling__test_catalog", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\data_profiling\\data_profiling__test_catalog.csv", "original_file_path": "seeds\\value_sets\\data_profiling\\data_profiling__test_catalog.csv", "unique_id": "seed.the_tuva_project.data_profiling__test_catalog", "fqn": ["the_tuva_project", "value_sets", "data_profiling", "data_profiling__test_catalog"], "alias": "_value_set_test_catalog", "checksum": {"name": "sha256", "checksum": "e2c0eb3fa96e8e3548466d5ca9b197f46b58e1998c9786940089759c8d0f019a"}, "config": {"enabled": true, "alias": "_value_set_test_catalog", "schema": "data_profiling", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://seeds\\value_sets\\data_profiling\\data_profiling__seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\data_profiling\\data_profiling__test_catalog.csv", "deferred": false, "unrendered_config": {"schema": "data_profiling", "alias": "_value_set_test_catalog", "tags": ["data_profiling"], "enabled": true, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "docs": {"node_color": "#141161"}}, "created_at": 1693946733.4991033, "relation_name": "tuva.data_profiling._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures_reporting__concepts": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures_reporting\\quality_measures_reporting__concepts.csv", "original_file_path": "seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting__concepts.csv", "unique_id": "seed.the_tuva_project.quality_measures_reporting__concepts", "fqn": ["the_tuva_project", "value_sets", "quality_measures_reporting", "quality_measures_reporting__concepts"], "alias": "_value_set_concepts", "checksum": {"name": "sha256", "checksum": "f28cb3d205e5b4cb76aaa18ef4ea22fa1cc01449da26c7344f67af23337936d7"}, "config": {"enabled": true, "alias": "_value_set_concepts", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Measures to concepts crosswalk. List of concepts used in each reporting measure.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting__concepts.csv", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_value_set_concepts", "tags": "quality_measures_reporting", "enabled": true}, "created_at": 1693946733.508416, "relation_name": "tuva.quality_measures_reporting._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures_reporting__measures": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__measures", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures_reporting\\quality_measures_reporting__measures.csv", "original_file_path": "seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting__measures.csv", "unique_id": "seed.the_tuva_project.quality_measures_reporting__measures", "fqn": ["the_tuva_project", "value_sets", "quality_measures_reporting", "quality_measures_reporting__measures"], "alias": "_value_set_measures", "checksum": {"name": "sha256", "checksum": "77e87e4828fb399da7178ace19a326e18d866818f81f21b3b5fa217b8e73032d"}, "config": {"enabled": true, "alias": "_value_set_measures", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting__measures.csv", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_value_set_measures", "tags": "quality_measures_reporting", "enabled": true}, "created_at": 1693946733.503855, "relation_name": "tuva.quality_measures_reporting._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures_reporting__value_sets": {"database": "tuva", "schema": "quality_measures_reporting", "name": "quality_measures_reporting__value_sets", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures_reporting\\quality_measures_reporting__value_sets.csv", "original_file_path": "seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting__value_sets.csv", "unique_id": "seed.the_tuva_project.quality_measures_reporting__value_sets", "fqn": ["the_tuva_project", "value_sets", "quality_measures_reporting", "quality_measures_reporting__value_sets"], "alias": "_value_set_codes", "checksum": {"name": "sha256", "checksum": "366585cf53299971c7c9adb3e0766053b9302dddee7f4d91ee543f955a6a8053"}, "config": {"enabled": true, "alias": "_value_set_codes", "schema": "quality_measures_reporting", "database": null, "tags": ["quality_measures_reporting"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures_reporting"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\quality_measures_reporting\\quality_measures_reporting__value_sets.csv", "deferred": false, "unrendered_config": {"schema": "quality_measures_reporting", "alias": "_value_set_codes", "tags": "quality_measures_reporting", "enabled": true, "column_types": {"code": "varchar"}}, "created_at": 1693946733.5162776, "relation_name": "tuva.quality_measures_reporting._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"database": "tuva", "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": "25a6477a528bc5ca29fd8153e9ed5e2d57e51ea0083d9d7b4ee288094b53ddfc"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_acute_diagnosis_ccs", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1693946733.5260062, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"database": "tuva", "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": "path", "checksum": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_icd_10_cm", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1693946733.5349946, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"database": "tuva", "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": "dae8093b0f00521519e1b68d90c82a63057d563a32bbd432372ee21757332298"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "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": "#161a7d"}}, "created_at": 1693946733.5430658, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "tuva", "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": "d4489c038d0c6f13f3d555b5341190a9cc1f517bd3f8e6be1dd2a9798c1be68f"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "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": "#161a7d"}}, "created_at": 1693946733.5484815, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "tuva", "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": "3ae458aa6c04a94f0a242e2a95300ff1a7836b6b195c484c446d5d1d91006e42"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1693946733.553478, "relation_name": "tuva.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"database": "tuva", "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": "2179b7310d7d12968dab5eed9efabf25e3a272c2e444e772e6c225b520c24236"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','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": "#161a7d"}}, "created_at": 1693946733.5639706, "relation_name": "tuva.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','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": "#161a7d"}}, "created_at": 1693946733.5750704, "relation_name": "tuva.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "05ebf37f0e71131e482e21ca079a59dbefe226bb90bec20ff623947ff29e63fe"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1693946733.5800688, "relation_name": "tuva.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"database": "tuva", "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": "43261c6967146c62f4d8e9a98b6a00e136601da9027728dd2feba3dad3222ddd"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1693946733.584056, "relation_name": "tuva.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__specialty_cohort": {"database": "tuva", "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": "22f4176d10237dcdd38294fc1e02cf0f17e8b9af193b91309b23949304f78608"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__specialty_cohort.csv", "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1693946733.5890515, "relation_name": "tuva.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"database": "tuva", "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": "b897008e5e7dc4d4f2c62272fb8ecaed11cbe56203c8eb8bf5e1c11b40a16d77"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "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": "#161a7d"}}, "created_at": 1693946733.596433, "relation_name": "tuva.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "tuva", "schema": "service_category", "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": "402bb239dab4163118f57998f27f386aaf30e09bea301b6f0d4f8be15862a8d4"}, "config": {"enabled": true, "alias": "_value_set_service_categories", "schema": "service_category", "database": null, "tags": ["service_category"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["service_category"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\service_categories\\service_categories_seeds.yml", "build_path": "../target\\run\\the_tuva_project\\seeds\\value_sets\\service_categories\\service_category__service_categories.csv", "deferred": false, "unrendered_config": {"schema": "service_category", "alias": "_value_set_service_categories", "tags": ["service_category"], "enabled": true}, "created_at": 1693946733.600549, "relation_name": "tuva.service_category._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\not_null_ccsr__singular_condition_category_claim_id.sql", "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1693946732.1720548, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["ccsr__singular_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\unique_ccsr__singular_condition_category_claim_id.sql", "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1693946732.1720548, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["ccsr__singular_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1693946732.2390597, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1693946732.2390597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1693946732.2390597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1693946732.2390597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1693946732.2482486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1693946732.2482486, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1693946732.2504413, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1693946732.2504413, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1693946732.2525246, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1693946732.2525246, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1693946732.25562, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1693946732.25562, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1693946732.2577121, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1693946732.2665076, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1693946732.2675898, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1693946732.2686992, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1693946732.2686992, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1693946732.300872, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1693946732.301869, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1693946732.3038623, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide"}, "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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__patient_risk_scores_patient_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1693946732.7555912, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_demographic_factors')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_demographic_factors_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_demographic_factors_patient_id.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.1e7ac0d681", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_demographic_factors_patient_id"], "alias": "unique_cms_hcc__int_demographic_factors_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_demographic_factors_patient_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1693946732.7566113, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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_demographic_factors_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom tuva.cms_hcc._int_demographic_factors\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "deferred": false, "unrendered_config": {}, "created_at": 1693946732.7586293, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_eligible_conditions"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition_code", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_members_patient_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1693946732.7596369, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_members"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_members_patient_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1693946732.7616315, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_members"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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 tuva.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": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members"}, "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || year_month)", "model": "{{ get_where_subquery(ref('financial_pmpm__pmpm_prep')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_financial_pmpm__pmpm_prep__patient_id___year_month_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_financial_pmpm__pmpm_prep__patient_id___year_month_.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_.ae2161e384", "fqn": ["the_tuva_project", "financial_pmpm", "unique_financial_pmpm__pmpm_prep__patient_id___year_month_"], "alias": "unique_financial_pmpm__pmpm_prep__patient_id___year_month_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\financial_pmpm\\financial_pmpm_models.yml\\unique_financial_pmpm__pmpm_prep__patient_id___year_month_.sql", "deferred": false, "unrendered_config": {}, "created_at": 1693946733.0477555, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["financial_pmpm__pmpm_prep"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "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_prep__patient_id___year_month_.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || year_month) as unique_field,\n count(*) as n_records\n\nfrom tuva.financial_pmpm.pmpm_prep\nwhere (patient_id || '_' || year_month) is not null\ngroup by (patient_id || '_' || year_month)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep"}, "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__condition_patient_id.ba929c7001": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures_reporting__stg_core__condition')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_quality_measures_reporting__stg_core__condition_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__condition_patient_id.ba929c7001", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "not_null_quality_measures_reporting__stg_core__condition_patient_id"], "alias": "not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0.sql", "deferred": false, "unrendered_config": {"alias": "not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0", "severity": "WARN"}, "created_at": 1693946733.1382797, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0\") }}", "language": "sql", "refs": [["quality_measures_reporting__stg_core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_c120fb412f5f36ea9e488667f59f47d0.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)select patient_id\nfrom __dbt__cte__quality_measures_reporting__stg_core__condition\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "sql": " __dbt__cte__quality_measures_reporting__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date as condition_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures_reporting__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_patient_id.041deb4a3f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures_reporting__stg_core__patient')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_quality_measures_reporting__stg_core__patient_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_patient_id.041deb4a3f", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "not_null_quality_measures_reporting__stg_core__patient_patient_id"], "alias": "not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813.sql", "deferred": false, "unrendered_config": {"alias": "not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813", "severity": "WARN"}, "created_at": 1693946733.1400235, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813\") }}", "language": "sql", "refs": [["quality_measures_reporting__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_907de9eb06c9c55d5a2800af7629c813.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)select patient_id\nfrom __dbt__cte__quality_measures_reporting__stg_core__patient\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "sql": " __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures_reporting__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_gender.d0ab41c19d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "gender", "model": "{{ get_where_subquery(ref('quality_measures_reporting__stg_core__patient')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_quality_measures_reporting__stg_core__patient_gender", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures_reporting__stg_core__patient_gender.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_gender.d0ab41c19d", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "not_null_quality_measures_reporting__stg_core__patient_gender"], "alias": "not_null_quality_measures_reporting__stg_core__patient_gender", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_reporting__stg_core__patient_gender.sql", "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1693946733.141071, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures_reporting__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_reporting__stg_core__patient_gender.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)select gender\nfrom __dbt__cte__quality_measures_reporting__stg_core__patient\nwhere gender is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "sql": " __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "gender", "file_key_name": "models.quality_measures_reporting__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male.f79cbe4ef9": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["female", "male"], "column_name": "gender", "model": "{{ get_where_subquery(ref('quality_measures_reporting__stg_core__patient')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "unique_id": "test.the_tuva_project.accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male.f79cbe4ef9", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male"], "alias": "accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c.sql", "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c"}, "created_at": 1693946733.1420875, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c\") }}", "language": "sql", "refs": [["quality_measures_reporting__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\accepted_values_quality_measur_944da2d14496625b7daaad47c32bf01c.sql", "compiled": true, "compiled_code": "\n \n \n\nwith __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n),all_values as (\n\n select\n gender as value_field,\n count(*) as n_records\n\n from __dbt__cte__quality_measures_reporting__stg_core__patient\n group by gender\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'female','male'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "sql": " __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "gender", "file_key_name": "models.quality_measures_reporting__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_birth_date.663daf5e0e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures_reporting__stg_core__patient')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_quality_measures_reporting__stg_core__patient_birth_date", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_birth_date.663daf5e0e", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "not_null_quality_measures_reporting__stg_core__patient_birth_date"], "alias": "not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76.sql", "deferred": false, "unrendered_config": {"alias": "not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76", "severity": "WARN"}, "created_at": 1693946733.1460636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76\") }}", "language": "sql", "refs": [["quality_measures_reporting__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_747bdacb6e16e54e1e31ab128567fe76.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)select birth_date\nfrom __dbt__cte__quality_measures_reporting__stg_core__patient\nwhere birth_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__patient", "sql": " __dbt__cte__quality_measures_reporting__stg_core__patient as (\n\nselect\n patient_id\n , sex as gender\n , birth_date\n , death_date\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "birth_date", "file_key_name": "models.quality_measures_reporting__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__procedure_patient_id.c39ccf18d3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures_reporting__stg_core__procedure')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_quality_measures_reporting__stg_core__procedure_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f.sql", "original_file_path": "models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__procedure_patient_id.c39ccf18d3", "fqn": ["the_tuva_project", "quality_measures", "quality_measures_reporting", "not_null_quality_measures_reporting__stg_core__procedure_patient_id"], "alias": "not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "../target\\run\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f.sql", "deferred": false, "unrendered_config": {"alias": "not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f", "severity": "WARN"}, "created_at": 1693946733.1476388, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f\") }}", "language": "sql", "refs": [["quality_measures_reporting__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"], "nodes": ["model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_reporting\\quality_measures_reporting_models.yml\\not_null_quality_measures_repo_06dc0f4ce9e2e090ba949a71e390456f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)select patient_id\nfrom __dbt__cte__quality_measures_reporting__stg_core__procedure\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "sql": " __dbt__cte__quality_measures_reporting__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-05 20:45:28.914033+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures_reporting__stg_core__procedure"}}, "sources": {}, "macros": {"macro.claims_data_model.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\generate_schema_name.sql", "original_file_path": "../macros\\generate_schema_name.sql", "unique_id": "macro.claims_data_model.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": 1693946729.7135005, "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 }} {% 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_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.7293837, "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 {% 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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.7293837, "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 schemas 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": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.7293837, "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": 1693946729.737387, "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": 1693946729.737387, "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": 1693946729.737387, "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": 1693946729.7383947, "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": 1693946729.7389011, "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": 1693946729.739425, "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": 1693946729.739425, "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": 1693946729.739425, "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": 1693946729.739425, "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": 1693946729.739425, "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": 1693946729.739425, "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": 1693946729.739425, "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": 1693946729.745214, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7494986, "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": 1693946729.7576926, "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 df.write.mode(\"overwrite\").save_as_table(\"{{ target_relation }}\", 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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1693946729.7576926, "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": 1693946729.7582853, "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": 1693946729.7582853, "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 return(to_return) %}\n\n {% do unset_query_tag(original_query_tag) %}\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": 1693946729.759355, "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": 1693946729.759355, "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": 1693946729.759355, "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": 1693946729.759355, "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": 1693946729.759355, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7604337, "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": 1693946729.7674427, "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": 1693946729.7684503, "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": 1693946729.7684503, "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": 1693946729.7684503, "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": 1693946729.7684503, "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": 1693946729.7684503, "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 select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.7719574, "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').table) }}\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": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.7719574, "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": 1693946729.776464, "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": 1693946729.7774668, "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": 1693946729.778473, "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": 1693946729.778473, "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": 1693946729.778473, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7794254, "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": 1693946729.7874322, "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": 1693946729.7874322, "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": 1693946729.7874322, "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": 1693946729.7874322, "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": 1693946729.788438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.7889438, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.79245, "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": 1693946729.7974536, "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": 1693946729.7984605, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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 is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.799481, "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": 1693946729.8054876, "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": 1693946729.8054876, "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": 1693946729.8054876, "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": 1693946729.8054876, "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": 1693946729.807494, "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": 1693946729.8085, "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": 1693946729.8085, "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": 1693946729.8085, "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": 1693946729.8085, "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": 1693946729.8085, "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": 1693946729.8085, "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": 1693946729.8085, "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": 1693946729.8125281, "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": 1693946729.8125281, "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": 1693946729.8185334, "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": 1693946729.8195524, "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": 1693946729.8246653, "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": 1693946729.8246653, "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": 1693946729.8246653, "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": 1693946729.8283443, "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": 1693946729.8283443, "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": 1693946729.8283443, "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": 1693946729.8324509, "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": 1693946729.8324509, "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": 1693946729.8375432, "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": 1693946729.8386335, "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": 1693946729.8397174, "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": 1693946729.8397174, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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": 1693946729.8408084, "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 as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1693946729.8408084, "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": 1693946729.8478975, "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=True) %}\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": 1693946729.849566, "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": 1693946729.849566, "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": 1693946729.849566, "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": 1693946729.849566, "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 }} as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1693946729.849566, "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": 1693946729.849566, "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": 1693946729.849566, "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": 1693946729.849566, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8581772, "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": 1693946729.8626876, "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": 1693946729.8626876, "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": 1693946729.8626876, "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": 1693946729.8681967, "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": 1693946729.869181, "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": 1693946729.869181, "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": 1693946729.869181, "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": 1693946729.869181, "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": 1693946729.87269, "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": 1693946729.87269, "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": 1693946729.8732474, "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": 1693946729.8732474, "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": 1693946729.8732474, "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": 1693946729.8732474, "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": 1693946729.8732474, "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": 1693946729.878256, "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": 1693946729.878256, "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": 1693946729.878256, "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": 1693946729.882763, "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": 1693946729.882763, "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": 1693946729.882763, "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": 1693946729.882763, "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": 1693946729.882763, "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": 1693946729.882763, "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 select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) 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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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": 1693946729.8892944, "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 resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\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": 1693946729.8892944, "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": 1693946729.8977995, "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": 1693946729.8983042, "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: ref(*args, 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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.8983042, "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": 1693946729.9028084, "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": 1693946729.9028084, "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": 1693946729.9028084, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9043097, "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": 1693946729.9078135, "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": 1693946729.9078135, "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": 1693946729.90832, "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": 1693946729.90832, "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": 1693946729.90832, "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": 1693946729.90832, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9093342, "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": 1693946729.9173415, "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": 1693946729.9173415, "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": 1693946729.9173415, "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": 1693946729.9183478, "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": 1693946729.9183478, "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": 1693946729.9183478, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.920355, "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": 1693946729.9273584, "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": 1693946729.9294171, "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": 1693946729.9294171, "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": 1693946729.9294171, "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": 1693946729.9294171, "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": 1693946729.9294171, "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": 1693946729.9294171, "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": 1693946729.9364238, "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": 1693946729.9374254, "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": 1693946729.9374254, "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": 1693946729.9384296, "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": 1693946729.9384296, "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": 1693946729.9384296, "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": 1693946729.9384296, "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": 1693946729.9384296, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.942434, "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": 1693946729.9474356, "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": 1693946729.9474356, "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": 1693946729.94844, "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": 1693946729.94844, "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": 1693946729.950037, "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": 1693946729.950037, "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": 1693946729.950037, "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": 1693946729.950037, "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": 1693946729.950037, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9525397, "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": 1693946729.9575412, "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": 1693946729.9585454, "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": 1693946729.9585454, "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": 1693946729.9585454, "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": 1693946729.9585454, "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": 1693946729.9625492, "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": 1693946729.9625492, "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": 1693946729.9625492, "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": 1693946729.9625492, "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": 1693946729.9625492, "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": 1693946729.9625492, "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": 1693946729.9675508, "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": 1693946729.9685545, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9695466, "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": 1693946729.9775505, "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": 1693946729.9775505, "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": 1693946729.9785557, "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": 1693946729.9785557, "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": 1693946729.9785557, "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": 1693946729.9785557, "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": 1693946729.9785557, "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": 1693946729.9785557, "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": 1693946729.9825602, "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": 1693946729.9825602, "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": 1693946729.9825602, "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": 1693946729.9825602, "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": 1693946729.984718, "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": 1693946729.9857168, "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": 1693946729.9882228, "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": 1693946729.9892957, "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": 1693946729.9892957, "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": 1693946729.9923089, "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": 1693946729.9964485, "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": 1693946729.9980426, "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": 1693946730.0006273, "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": 1693946730.0011287, "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": 1693946730.002127, "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": 1693946730.002127, "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": 1693946730.002127, "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": 1693946730.0031235, "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": 1693946730.0031235, "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": 1693946730.004221, "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": 1693946730.004221, "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": 1693946730.004221, "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": 1693946730.004221, "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": 1693946730.004221, "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": 1693946730.004221, "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\\eligibility_missing_column_check.sql", "original_file_path": "macros\\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 , '{{ 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": 1693946730.004221, "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": 1693946730.004221, "supported_languages": null}, "macro.the_tuva_project.header_duplicate_check": {"name": "header_duplicate_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\header_duplicate_check.sql", "original_file_path": "macros\\header_duplicate_check.sql", "unique_id": "macro.the_tuva_project.header_duplicate_check", "macro_sql": "{% macro 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 , '{{ 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 claim_id\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": 1693946730.004221, "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": 1693946730.008418, "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": 1693946730.008418, "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": 1693946730.008418, "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 )\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": 1693946730.0125363, "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 {% if headers == true %}\r\n {% do collist.append(col.name ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n {% else %}\r\n {% do collist.append(\"_c\" ~ loop.index0 ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n {% endif %}\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 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)\r\nFILEFORMAT = CSV\r\nPATTERN = '{{ pattern }}*'\r\nFORMAT_OPTIONS (\r\n {% if headers == true %} 'header' = 'true', {% else %} 'header' = 'false', {% 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": 1693946730.015328, "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": 1693946730.0169115, "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\\medical_claim_missing_column_check.sql", "original_file_path": "macros\\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 , '{{ 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": 1693946730.0174885, "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\\pharmacy_claim_missing_column_check.sql", "original_file_path": "macros\\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 , '{{ 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": 1693946730.0174885, "supported_languages": null}}, "docs": {"doc.claims_data_model.__the_tuva_project__": {"name": "__the_tuva_project__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__the_tuva_project__", "block_contents": "# \ud83c\udf0e\u00a0The Tuva Project\r\n## \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is messy, and working with it is hard! Analytics teams spend countless hours ingesting, cleaning and transforming healthcare data in order to get it ready for analytics and machine learning. Healthcare knowledge and code are siloed; countless institutions are wasting hours duplicating the same work, and when mistakes are made or issues are missed, the insights gained from the analytics have little value.\r\n\r\nTuva Health is aiming to change that with the launch of The Tuva Project. We're making it easy to get value out of your healthcare data by open sourcing the code needed to transform your data, publishing a knowledgebase of healthcare concepts and artifacts to make it easy to understand and learn about healthcare data, and building an online community of healthcare data professionals to share insights and get help.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/docs/intro)\r\nWe're working towards building a complete knowledgebase of healthcare data concepts, covering everything from getting started with healthcare data through higher level analytics concepts. You can [help contribute](https://thetuvaproject.com/docs/how-to-contribute/edit-github) by adding new pages through github.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/)\r\nWe're open-sourcing code to help transform your healthcare data. Built just import this dbt package, just map your data to our input layer and instantly transform your data into helpful core concepts, get data marts for some of the most common analytics applications, get insights about your data quality and how it changes over time, and easily import some of the most useful healthcare terminology sets into your data warehouse.\r\n\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nStill stuck? Join our slack community of healthcare data professionals and get answers to your healthcare data questions, communicate directly with the engineers working on The Tuva Project, and get the latest updates.\r\n\r\n## \u2049\u00a0What is this package and how do I use it?\r\n\r\nThis is The Tuva Project, a [dbt package](https://docs.getdbt.com/docs/build/packages) that imports all of the packages developed by Tuva Health. Running The Tuva Project is as simple as [mapping](https://thetuvaproject.com/docs/claims-data-warehouse/setup) your data to our input layer, adding the_tuva_project to your packages.yml, and running `dbt deps` and `dbt build`. See our [readme](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) for more detailed setup instructions. If you are new to dbt, check out [their documentation](https://docs.getdbt.com/docs/introduction) for tips on getting started.\r\n\r\nThis package will import the following packages:\r\n- [data_profiling](https://github.com/tuva-health/data_profiling): Runs data quality tests to check for common problems specific to healthcare claims data.\r\n- [claims_preprocessing](https://github.com/tuva-health/claims_preprocessing): Groups overlapping claims into a single encounter, assigns every claim to 1 of 15 different encounter types and populates core concept tables.\r\n- [cms_chronic_conditions](https://github.com/tuva-health/chronic_conditions): Implements a chronic condition grouper based on ICD-10-CM codes. As a result, it is possible to know whether each patient in your population has any of ~70 different chronic conditions defined for the grouper.\r\n- [tuva_chronic_conditions](https://github.com/tuva-health/tuva_chronic_conditions): implements a chronic condition grouper created by the Tuva Project which creates ~40 homogeneous and mutually exclusive chronic condition groups on your patient.\r\n- [pmpm](https://github.com/tuva-health/pmpm): Calculates spend and utilization metrics for your patient population on a per-member-per-month (pmpm) basis.\r\n- [readmissions](https://github.com/tuva-health/readmissions): Calculates hospital readmission measures.\r\n- [terminology](https://github.com/tuva-health/terminology): Makes the latest version of many useful healthcare terminology datasets available as tables in your data warehouse. This package is different from the others because it does not build healthcare concepts on top of your data."}, "doc.claims_data_model.__the_tuva_project_input__": {"name": "__the_tuva_project_input__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__the_tuva_project_input__", "block_contents": "# \ud83e\uddf0\u00a0The Tuva Project Input Layer\r\n\r\nIn order to run The Tuva Project, you will need to start by creating the following 3 models in your dbt project with their appropriate structures:\r\n- [eligibility](https://tuva-health.github.io/the_tuva_project/#!/model/model.the_tuva_project_input.eligibility): A table with eligibility coverage spans for all patients.\r\n- [medical_claim](https://tuva-health.github.io/the_tuva_project/#!/model/model.the_tuva_project_input.medical_claim): A table at the claim line grain housing claim, condition, and procedure information for professional and institutional claims. \r\n- [pharmacy_claim](https://tuva-health.github.io/the_tuva_project/#!/model/model.the_tuva_project_input.pharmacy_claim): A table housing pharmacy claim details.\r\n\r\nFor more detailed instructions and guidance, see our [mapping guide](https://thetuvaproject.com/docs/claims-data-warehouse/setup)"}, "doc.claims_data_model.__readmissions__": {"name": "__readmissions__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__readmissions__", "block_contents": "# \ud83d\udce6\u00a0Readmissions\r\n\r\nHospital Readmissions are when a patient returns to the hospital within 30 days of a previous encounter for the same or a related condition. A hospital's readmission rate is often used to measure quality of care, and [CMS reduces reimbursements](https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/Value-Based-Programs/HRRP/Hospital-Readmission-Reduction-Program) according to an adjustment factor correlated with the readmission measures.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package produces a mart which calculates which encounters are readmissions. It produces the following two main output tables:\r\n\r\n| Table | Definition |\r\n|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [encounter_augmented](#!/model/model.readmissions.readmissions__encounter_augmented#description) | A table at the encounter grain including details about which encounters were flagged for readmissions and other flags indicating why or why not the encounter was flagged |\r\n| [readmission_summary](#!/model/model.readmissions.readmissions__readmission_summary#description) | A table table showing all encounters that were not disqualified for data quality reasons, with flags indicating if the encounter had readmissions and other relevant information |\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Readmissions](https://thetuvaproject.com/docs/analytics/readmissions) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/readmissions/latest/) or [GitHub](https://github.com/tuva-health/readmissions)"}, "doc.claims_data_model.__data_profiling__": {"name": "__data_profiling__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__data_profiling__", "block_contents": "# \ud83d\udce6\u00a0Data Profiling\r\n\r\nData Profiling is the process of examining and analyzing your data to gain insights into its quality. This package runs a variety of tests against the input tables you have mapped in the Claims Data Model that will help identify data quality problems or mapping issues that could affect downstream analytics.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nData Profiling produces 3 detail tables that provide row-level data quality insights for your mapped Claims Data Model models, and a summary table that provides a high level overview into all three tables. \r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\r\n| [summary](#!/model/model.data_profiling.data_profiling__summary#description) | A high level table that summarizes and aggregates the data quality issues in `medical_claim`, `pharmacy_claim`, and `eligibility` |\r\n| [test_detail](#!/model/model.data_profiling.data_profiling__test_detail#description) | A table detailing every failed claim or eligibility record with details on the tests that failed and links back to the source table |\r\n| [test_results](#!/model/model.data_profiling.data_profiling__test_results#description) | A table that shows pass/fail counts and percentages for every test on every input table |\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Data Profiling](https://thetuvaproject.com/docs/analytics/data-profiling) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/data_profiling/latest/) or [GitHub](https://github.com/tuva-health/data_profiling)"}, "doc.claims_data_model.__claims_preprocessing__": {"name": "__claims_preprocessing__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__claims_preprocessing__", "block_contents": "# \ud83d\udce6\u00a0Claims Preprocessing\r\n\r\nClaims data in its raw form is not built with analytics in mind. This package takes the Claims Data Model tables you have created, and produces tables more readily built for analytics. It also groups claims into encounters, and infers an encounter type based on the data in the claims.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package produces the core schema, which enhances the Claims Data Model and together serve as the fundamental building blocks other packages in The Tuva Project build upon. \r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\r\n| [condition](#!/model/model.claims_preprocessing.claims_preprocessing__condition#description) | A table containing all conditions diagnosed in the claims data |\r\n| [encounter](#!/model/model.claims_preprocessing.claims_preprocessing__encounter#description) | A table containing all encounters and encounter types identified in the claims data |\r\n| [patient](#!/model/model.claims_preprocessing.claims_preprocessing__patient#description) | A table containing all patients present in the enrollment data |\r\n| [prescription](#!/model/model.claims_preprocessing.claims_preprocessing__prescription#description) | A table containing all medications prescribed to a patient |\r\n| [procedure](#!/model/model.claims_preprocessing.claims_preprocessing__procedure#description) | A table containing all procedures performed on a patient in the claims data |\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/claims_preprocessing/latest/) or [GitHub](https://github.com/tuva-health/claims_preprocessing)"}, "doc.claims_data_model.__terminology__": {"name": "__terminology__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__terminology__", "block_contents": "# \ud83d\udce6\u00a0Terminology\r\n\r\nClaims data utilizes numerous code sets to convey critical information, but generally does not include human readable descriptions of those codes. The Terminology Package provides an easy way of loading those dictionaries as well as common mappings and groupers, so you can get more meaningful insight into your data.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package loads numerous healthcare terminology sets into your warehouse. Please navigate the project tree in these docs for more information, or see [github](https://github.com/tuva-health/terminology/tree/main/terminology) for the raw list of files and their contents.\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/terminology/latest/) or [GitHub](https://github.com/tuva-health/terminology)"}, "doc.claims_data_model.__cms_chronic_conditions__": {"name": "__cms_chronic_conditions__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__cms_chronic_conditions__", "block_contents": "# \ud83d\udce6\u00a0CMS Chronic Conditions\r\n\r\nThe OEDA and CMS have develeoped a [set of information products and analytics](https://www.cms.gov/Research-Statistics-Data-and-Systems/Statistics-Trends-and-Reports/Chronic-Conditions) examining chronic conditions among Medicare beneficiaries. Identifying patients with chronic conditions will help provide an understanding of the burden and implications for the healthcare system, help identify high-risk patients, and help inform about resource utilization of patients with chronic diseases.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package calculates which patients have chronic conditions per the CMS methodological standards, and produces that information in two tables at the patient grain and at the patient-condition grain\r\n\r\n| Table | Definition |\r\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [chronic_conditions_pivoted](#!/model/model.cms_chronic_conditions.cms_chronic_conditions__chronic_conditions_pivoted#description) | A table at the patient grain, with a row for each patient and a column for each chronic condition and a flag indicating if they have that condition |\r\n| [chronic_conditions_unioned](#!/model/model.cms_chronic_conditions.cms_chronic_conditions__chronic_conditions_unioned#description) | A table at the patient-condition grain, with a row for every chronic condition identified in the data |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Chronic Conditions](https://thetuvaproject.com/docs/analytics/chronic-conditions) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/cms_chronic_conditions/latest/) or [GitHub](https://github.com/tuva-health/cms_chronic_conditions)"}, "doc.claims_data_model.__tuva_chronic_conditions__": {"name": "__tuva_chronic_conditions__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__tuva_chronic_conditions__", "block_contents": "# \ud83d\udce6\u00a0Tuva Chronic Conditions\r\n\r\nIdentifying patients with chronic conditions will help provide an understanding of the burden and implications for the healthcare system, help identify high-risk patients, and help inform about resource utilization of patients with chronic diseases.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package calculates which patients have chronic conditions, and produces that information in two tables at the patient grain and at the patient-condition grain, and provides a table for grouping conditions into condition families.\r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [chronic_condition_groups](#!/model/model.tuva_chronic_conditions.tuva_chronic_conditions__chronic_condition_groups#description) | A table with mappings between all of the chronic conditions and their logical condition families |\r\n| [chronic_conditions_long](#!/model/model.tuva_chronic_conditions.tuva_chronic_conditions__chronic_conditions_long#description) | A table at the patient-condition grain, with a row for every chronic condition identified in the data |\r\n| [chronic_conditions_wide](#!/model/model.tuva_chronic_conditions.tuva_chronic_conditions__chronic_conditions_wide#description) | A table at the patient grain, with a row for each patient and a column for each chronic condition and a flag indicating if they have that condition |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Chronic Conditions](https://thetuvaproject.com/docs/analytics/chronic-conditions) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/tuva_chronic_conditions/latest/) or [GitHub](https://github.com/tuva-health/tuva_chronic_conditions)"}, "doc.claims_data_model.__pmpm__": {"name": "__pmpm__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__pmpm__", "block_contents": "# \ud83d\udce6\u00a0PMPM\r\n\r\nPMPM (cost per member per month) is a common healthcare financial benchmark, which calculates the average cost of healthcare per member enrolled per month. \r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package produces one table, whcih can be used to build PMPM calculations and perform related analytics\r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\r\n| [pmpm_builder](#!/model/model.pmpm.pmpm__pmpm_builder#description) | A table at the patient-month grain, with a row for month every patient has coverage, and the total and detailed spend for that month |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/pmpm/latest/) or [GitHub](https://github.com/tuva-health/pmpm)"}, "doc.claims_data_model.__claims_data_model__": {"name": "__claims_data_model__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__claims_data_model__", "block_contents": "# \ud83d\udce6\u00a0Claims Data Model\r\n\r\nThe first step to using The Tuva Project is to map your claims data to the Claims Data Model. The Tuva Project expects your project to have three models containing your [medical_claim](#!/model/model.claims_data_model.medical_claim#description), [pharmacy_claim](#!/model/model.claims_data_model.pharmacy_claim#description), and [eligibiilty](#!/model/model.claims_data_model.eligibility#description) data in the expected format. All packages in The Tuva Project ecosystem run off of these core tables.\r\n\r\n### \ud83d\udca1\u00a0Tips for getting started:\r\n- Read through our [Mappping Guide](https://thetuvaproject.com/docs/claims-data-warehouse/setup) for tips on how to map the models.\r\n- Check out the [Tuva Project Readme](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) for more details on how to get started with the tuva project.\r\n- Use the [Data Profiling](#!/overview/readmissions) package to validate your models, and make sure there aren't any issues that would affect downstream packages or analytics.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What models do I need to build in order for The Tuva Project to run?\r\n\r\nCreate the following models in your dbt project:\r\n\r\n| Table | Definition |\r\n|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [eligibility](#!/model/model.claims_data_model.eligibility#description) | A model detailing eligibility spans for all patients in your population |\r\n| [medical_claim](#!/model/model.claims_data_model.medical_claim#description) | A model containing all of the claim-line level information from your claims including claim type, provider info, charge/payment info, conditions, and procedures |\r\n| [pharmacy_claim](#!/model/model.claims_data_model.pharmacy_claim#description) | A model containing all of the medications prescribed and administered in pharmacy claims |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Read the [Mapping Guide](https://thetuvaproject.com/docs/claims-data-warehouse/setup), for more info on how to get started\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)"}, "doc.claims_data_model.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "claims_data_model", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.claims_data_model.__overview__", "block_contents": "# \ud83c\udf0e\u00a0The Tuva Project\r\n## \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is messy, and working with it is hard! Analytics teams spend countless hours ingesting, cleaning and transforming healthcare data in order to get it ready for analytics and machine learning. Healthcare knowledge and code are siloed; countless institutions are wasting hours duplicating the same work, and when mistakes are made or issues are missed, the insights gained from the analytics have little value.\r\n\r\nTuva Health is aiming to change that with the launch of The Tuva Project. We're making it easy to get value out of your healthcare data by open sourcing the code needed to transform your data, publishing a knowledgebase of healthcare concepts and artifacts to make it easy to understand and learn about healthcare data, and building an online community of healthcare data professionals to share insights and get help.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/docs/intro)\r\nWe're working towards building a complete knowledgebase of healthcare data concepts, covering everything from getting started with healthcare data through higher level analytics concepts. You can [help contribute](https://thetuvaproject.com/docs/how-to-contribute/edit-github) by adding new pages through github.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/)\r\nWe're open-sourcing code to help transform your healthcare data. Built just import this dbt package, just map your data to our input layer and instantly transform your data into helpful core concepts, get data marts for some of the most common analytics applications, get insights about your data quality and how it changes over time, and easily import some of the most useful healthcare terminology sets into your data warehouse.\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nStill stuck? Join our slack community of healthcare data professionals and get answers to your healthcare data questions, communicate directly with the engineers working on The Tuva Project, and get the latest updates.\r\n\r\n## \u2049\u00a0What is this package and how do I use it?\r\n\r\nThis is The Tuva Project, a [dbt package](https://docs.getdbt.com/docs/build/packages) that imports all of the packages developed by Tuva Health. Running The Tuva Project is as simple as [mapping](https://thetuvaproject.com/docs/claims-data-warehouse/setup) your data to our input layer, adding the_tuva_project to your packages.yml, and running `dbt deps` and `dbt build`. See our [readme](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) for more detailed setup instructions. If you are new to dbt, check out [their documentation](https://docs.getdbt.com/docs/introduction) for tips on getting started.\r\n\r\nThis package will import the following packages:\r\n- [data_profiling](https://github.com/tuva-health/data_profiling): Runs data quality tests to check for common problems specific to healthcare claims data.\r\n- [claims_preprocessing](https://github.com/tuva-health/claims_preprocessing): Groups overlapping claims into a single encounter, assigns every claim to 1 of 15 different encounter types and populates core concept tables.\r\n- [cms_chronic_conditions](https://github.com/tuva-health/chronic_conditions): Implements a chronic condition grouper based on ICD-10-CM codes. As a result, it is possible to know whether each patient in your population has any of ~70 different chronic conditions defined for the grouper.\r\n- [tuva_chronic_conditions](https://github.com/tuva-health/tuva_chronic_conditions): implements a chronic condition grouper created by the Tuva Project which creates ~40 homogeneous and mutually exclusive chronic condition groups on your patient.\r\n- [pmpm](https://github.com/tuva-health/pmpm): Calculates spend and utilization metrics for your patient population on a per-member-per-month (pmpm) basis.\r\n- [readmissions](https://github.com/tuva-health/readmissions): Calculates hospital readmission measures.\r\n- [terminology](https://github.com/tuva-health/terminology): Makes the latest version of many useful healthcare terminology datasets available as tables in your data warehouse. This package is different from the others because it does not build healthcare concepts on top of your 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": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.claims_data_model.condition": [], "model.claims_data_model.eligibility": [], "model.claims_data_model.encounter": [], "model.claims_data_model.lab_result": [], "model.claims_data_model.location": [], "model.claims_data_model.medical_claim": [], "model.claims_data_model.medication": [], "model.claims_data_model.observation": [], "model.claims_data_model.patient": [], "model.claims_data_model.pharmacy_claim": [], "model.claims_data_model.practitioner": [], "model.claims_data_model.procedure": [], "seed.claims_data_model.eligibility_seed": [], "seed.claims_data_model.medical_claim_seed": [], "seed.claims_data_model.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__wide_condition_category": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__wide_procedure_category": ["model.the_tuva_project.ccsr__long_procedure_category", "model.the_tuva_project.ccsr__procedure_category_map"], "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", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"], "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.claims_data_model.medical_claim"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.claims_data_model.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.acute_inpatient__summary": ["model.claims_data_model.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__institutional_encounter_id", "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__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__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__institutional_claims": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_claims"], "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__service_category_grouper"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.claims_data_model.eligibility"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.claims_date_profiling__date_issues": ["model.claims_data_model.eligibility", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.claims_date_profiling__date_summary": ["model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__medical_claim_dates", "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates"], "model.the_tuva_project.claims_date_profiling__duplicate_dates": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.claims_date_profiling__medical_claim_dates": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": ["model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.data_profiling__summary": ["model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_detail": ["model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__test_result": ["model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__use_case": ["model.claims_data_model.eligibility", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim", "model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__claim_type_mapping_failures": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__claim_type_unmapped": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__eligibility_denominators": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__eligibility_duplicates": ["model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__eligibility_invalid_values": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "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_profiling__eligibility_missing_values": ["model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__eligibility_plausibility": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__institutional_header_failures": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__institutional_header_fail_details": ["model.the_tuva_project.data_profiling__institutional_header_failures"], "model.the_tuva_project.data_profiling__medical_claim_denominators": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_duplicates": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_invalid_values": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.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__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_profiling__medical_claim_plausibility": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": ["model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": ["model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.data_profiling__professional_header_failures": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__professional_header_fail_details": ["model.the_tuva_project.data_profiling__professional_header_failures"], "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": ["model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_plausibility"], "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": ["model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_plausibility", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__professional_header_fail_details"], "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"], "model.the_tuva_project.data_profiling__test_result_stage_eligibility": ["model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": ["model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": ["model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"], "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__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__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__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__emergency_department_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__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.claims_data_model.medical_claim"], "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_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_eligibility"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_hcc__stg_eligibility": ["model.claims_data_model.eligibility"], "model.the_tuva_project.cms_hcc__stg_medical_claim": ["model.claims_data_model.medical_claim"], "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.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "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.claims_data_model.eligibility"], "model.the_tuva_project.core__stg_claims_encounter": ["model.the_tuva_project.acute_inpatient__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", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.core__stg_claims_patient": ["model.claims_data_model.eligibility"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.claims_data_model.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", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_procedure": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.core__stg_clinical_condition": ["model.claims_data_model.condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.claims_data_model.encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.claims_data_model.lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.claims_data_model.location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.claims_data_model.medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.claims_data_model.observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.claims_data_model.patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.claims_data_model.practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.claims_data_model.procedure"], "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": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["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__stg_member_months"], "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_member_months": ["model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.quality_measures_reporting__summary_counts": ["model.the_tuva_project.quality_measures_reporting__summary_long"], "model.the_tuva_project.quality_measures_reporting__summary_long": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_long"], "model.the_tuva_project.quality_measures_reporting__summary_wide": ["model.the_tuva_project.quality_measures_reporting__summary_long"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "seed.the_tuva_project.quality_measures_reporting__measures", "seed.the_tuva_project.quality_measures_reporting__measures", "seed.the_tuva_project.quality_measures_reporting__measures", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator", "model.the_tuva_project.quality_measures_reporting__stg_core__patient"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__stg_core__procedure", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "seed.the_tuva_project.quality_measures_reporting__value_sets"], "model.the_tuva_project.quality_measures_reporting__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.quality_measures_reporting__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.quality_measures_reporting__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.quality_measures_reporting__stg_medical_claim": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim": ["model.claims_data_model.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__diagnosis": ["model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.readmissions__diagnosis_ccs": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__primary_diagnosis_count", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "seed.the_tuva_project.terminology__icd_10_cm"], "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__diagnosis_ccs", "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__primary_diagnosis_count", "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__diagnosis_ccs", "model.the_tuva_project.readmissions__encounter", "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__exclusion": ["model.the_tuva_project.readmissions__diagnosis_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__diagnosis_ccs", "model.the_tuva_project.readmissions__diagnosis_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__primary_diagnosis_count": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__diagnosis"], "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__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "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__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": [], "seed.the_tuva_project.terminology__medicare_status": [], "seed.the_tuva_project.terminology__ms_drg": [], "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__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.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_profiling__test_catalog": [], "seed.the_tuva_project.quality_measures_reporting__concepts": [], "seed.the_tuva_project.quality_measures_reporting__measures": [], "seed.the_tuva_project.quality_measures_reporting__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.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_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.1e7ac0d681": ["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_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__condition_patient_id.ba929c7001": ["model.the_tuva_project.quality_measures_reporting__stg_core__condition"], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_patient_id.041deb4a3f": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_gender.d0ab41c19d": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"], "test.the_tuva_project.accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male.f79cbe4ef9": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_birth_date.663daf5e0e": ["model.the_tuva_project.quality_measures_reporting__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__procedure_patient_id.c39ccf18d3": ["model.the_tuva_project.quality_measures_reporting__stg_core__procedure"]}, "child_map": {"model.claims_data_model.condition": ["model.the_tuva_project.core__stg_clinical_condition"], "model.claims_data_model.eligibility": ["model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__date_issues", "model.the_tuva_project.cms_hcc__stg_eligibility", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__use_case"], "model.claims_data_model.encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.claims_data_model.lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "model.claims_data_model.location": ["model.the_tuva_project.core__stg_clinical_location"], "model.claims_data_model.medical_claim": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__date_issues", "model.the_tuva_project.claims_date_profiling__date_issues", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__medical_claim_dates", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_hcc__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.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__institutional_header_failures", "model.the_tuva_project.data_profiling__institutional_header_failures", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_plausibility", "model.the_tuva_project.data_profiling__medical_claim_plausibility", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__professional_header_failures", "model.the_tuva_project.data_profiling__professional_header_failures", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.quality_measures_reporting__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"], "model.claims_data_model.medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.claims_data_model.observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.claims_data_model.patient": ["model.the_tuva_project.core__stg_clinical_patient"], "model.claims_data_model.pharmacy_claim": ["model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.core__stg_claims_pharmacy_claim", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim"], "model.claims_data_model.practitioner": ["model.the_tuva_project.core__stg_clinical_practitioner"], "model.claims_data_model.procedure": ["model.the_tuva_project.core__stg_clinical_procedure"], "seed.claims_data_model.eligibility_seed": [], "seed.claims_data_model.medical_claim_seed": [], "seed.claims_data_model.pharmacy_claim_seed": [], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__singular_condition_category", "model.the_tuva_project.ccsr__wide_condition_category"], "model.the_tuva_project.ccsr__long_procedure_category": ["model.the_tuva_project.ccsr__wide_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__wide_condition_category": [], "model.the_tuva_project.ccsr__wide_procedure_category": [], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["model.the_tuva_project.ccsr__long_condition_category", "model.the_tuva_project.ccsr__wide_condition_category"], "model.the_tuva_project.ccsr__procedure_category_map": ["model.the_tuva_project.ccsr__long_procedure_category", "model.the_tuva_project.ccsr__wide_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", "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.chronic_conditions__tuva_chronic_conditions_wide"], "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.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_procedure"], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "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_medical_claim"], "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__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__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__institutional_claims", "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__service_category_grouper": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": [], "model.the_tuva_project.claims_date_profiling__date_issues": [], "model.the_tuva_project.claims_date_profiling__date_summary": [], "model.the_tuva_project.claims_date_profiling__duplicate_dates": ["model.the_tuva_project.claims_date_profiling__date_summary"], "model.the_tuva_project.claims_date_profiling__medical_claim_dates": ["model.the_tuva_project.claims_date_profiling__date_summary"], "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": ["model.the_tuva_project.claims_date_profiling__date_summary"], "model.the_tuva_project.data_profiling__summary": [], "model.the_tuva_project.data_profiling__test_detail": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case"], "model.the_tuva_project.data_profiling__test_result": [], "model.the_tuva_project.data_profiling__use_case": [], "model.the_tuva_project.data_profiling__claim_type_mapping_failures": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__claim_type_unmapped": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__eligibility_denominators": ["model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_duplicates": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_invalid_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_plausibility": ["model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__institutional_header_failures": ["model.the_tuva_project.data_profiling__institutional_header_fail_details"], "model.the_tuva_project.data_profiling__institutional_header_fail_details": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_denominators": ["model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_duplicates": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_invalid_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_plausibility": ["model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__professional_header_failures": ["model.the_tuva_project.data_profiling__professional_header_fail_details"], "model.the_tuva_project.data_profiling__professional_header_fail_details": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": ["model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": ["model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_result_stage_eligibility": ["model.the_tuva_project.data_profiling__test_result"], "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": ["model.the_tuva_project.data_profiling__test_result"], "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__test_result"], "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__service_category_grouper", "model.the_tuva_project.core__stg_claims_medical_claim"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__combined_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__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__home_health_professional", "model.the_tuva_project.service_category__skilled_nursing_professional"], "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__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__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.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__patient_risk_scores", "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot", "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.1e7ac0d681"], "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_eligibility": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__stg_medical_claim": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "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.quality_measures_reporting__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.financial_pmpm__stg_eligibility"], "model.the_tuva_project.core__encounter": ["model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.core__lab_result": [], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.readmissions__stg_core__medical_claim"], "model.the_tuva_project.core__medication": [], "model.the_tuva_project.core__observation": [], "model.the_tuva_project.core__patient": ["model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "model.the_tuva_project.quality_measures_reporting__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.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_reporting__stg_core__procedure", "model.the_tuva_project.readmissions__stg_core__procedure"], "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.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_member_months"], "model.the_tuva_project.financial_pmpm__pmpm": [], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__pmpm", "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384"], "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_member_months": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.quality_measures_reporting__summary_counts": [], "model.the_tuva_project.quality_measures_reporting__summary_long": ["model.the_tuva_project.quality_measures_reporting__summary_counts", "model.the_tuva_project.quality_measures_reporting__summary_wide"], "model.the_tuva_project.quality_measures_reporting__summary_wide": [], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_long"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long": ["model.the_tuva_project.quality_measures_reporting__summary_long"], "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_long"], "model.the_tuva_project.quality_measures_reporting__stg_core__condition": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__condition_patient_id.ba929c7001"], "model.the_tuva_project.quality_measures_reporting__stg_core__patient": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long", "test.the_tuva_project.accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male.f79cbe4ef9", "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_birth_date.663daf5e0e", "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_gender.d0ab41c19d", "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_patient_id.041deb4a3f"], "model.the_tuva_project.quality_measures_reporting__stg_core__procedure": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator", "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__procedure_patient_id.c39ccf18d3"], "model.the_tuva_project.quality_measures_reporting__stg_medical_claim": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator"], "model.the_tuva_project.quality_measures_reporting__stg_pharmacy_claim": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_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__diagnosis": ["model.the_tuva_project.readmissions__diagnosis_ccs", "model.the_tuva_project.readmissions__primary_diagnosis_count", "model.the_tuva_project.readmissions__primary_diagnosis_count"], "model.the_tuva_project.readmissions__diagnosis_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__encounter": ["model.the_tuva_project.readmissions__encounter_augmented", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "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__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__primary_diagnosis_count": ["model.the_tuva_project.readmissions__diagnosis_ccs", "model.the_tuva_project.readmissions__encounter_data_quality"], "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__diagnosis"], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__stg_core__medical_claim": [], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.readmissions__procedure_ccs"], "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": [], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": [], "seed.the_tuva_project.terminology__admit_source": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values"], "seed.the_tuva_project.terminology__admit_type": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values"], "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_profiling__medical_claim_invalid_values", "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_profiling__medical_claim_invalid_values", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__calendar": ["model.the_tuva_project.financial_pmpm__member_months"], "seed.the_tuva_project.terminology__claim_type": ["model.the_tuva_project.data_profiling__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_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values"], "seed.the_tuva_project.terminology__discharge_disposition": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "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_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__hcpcs_level_2": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__icd_10_cm": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.readmissions__diagnosis_ccs"], "seed.the_tuva_project.terminology__icd_10_pcs": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__icd_9_cm": [], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_status": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__ms_drg": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "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__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__payer_type": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__place_of_service": ["model.the_tuva_project.data_profiling__medical_claim_invalid_values", "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_profiling__medical_claim_invalid_values"], "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"], "seed.the_tuva_project.terminology__race": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__revenue_center": ["model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.service_category__dq_input_layer_tests"], "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": ["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"], "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_profiling__test_catalog": [], "seed.the_tuva_project.quality_measures_reporting__concepts": [], "seed.the_tuva_project.quality_measures_reporting__measures": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator"], "seed.the_tuva_project.quality_measures_reporting__value_sets": ["model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator"], "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__diagnosis_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.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_cms_hcc__patient_risk_scores_patient_id.05b154e126": [], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": [], "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_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384": [], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__condition_patient_id.ba929c7001": [], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_patient_id.041deb4a3f": [], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_gender.d0ab41c19d": [], "test.the_tuva_project.accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male.f79cbe4ef9": [], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_birth_date.663daf5e0e": [], "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__procedure_patient_id.c39ccf18d3": []}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v8.json", "dbt_version": "1.4.5", "generated_at": "2023-09-12T13:15:20.883516Z", "invocation_id": "d3420436-3f9f-40f8-9264-25572b056af6", "env": {}, "project_id": "228f02ae210381b07ccf62fcaa654d94", "user_id": "7acd446d-f397-41c9-9f69-07656e135a86", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.claims_data_model.condition": {"database": "tuva", "schema": "claims_data_model", "name": "condition", "resource_type": "model", "package_name": "claims_data_model", "path": "condition.sql", "original_file_path": "models\\condition.sql", "unique_id": "model.claims_data_model.condition", "fqn": ["claims_data_model", "condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "9cdc84897903c87ec4ad9aed73dfea03ac3bf67d5a9dc7e9a4367df79d6bc0a0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3653343, "relation_name": "tuva.claims_data_model.condition", "raw_code": "select\r\n null as condition_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as recorded_date\r\n, null as onset_date\r\n, null as resolved_date\r\n, null as status\r\n, null as condition_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as condition_rank\r\n, null as present_on_admit_code\r\n, null as present_on_admit_description\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\condition.sql", "compiled": true, "compiled_code": "select\r\n null as condition_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as recorded_date\r\n, null as onset_date\r\n, null as resolved_date\r\n, null as status\r\n, null as condition_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as condition_rank\r\n, null as present_on_admit_code\r\n, null as present_on_admit_description\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.eligibility": {"database": "tuva", "schema": "claims_data_model", "name": "eligibility", "resource_type": "model", "package_name": "claims_data_model", "path": "eligibility.sql", "original_file_path": "models\\eligibility.sql", "unique_id": "model.claims_data_model.eligibility", "fqn": ["claims_data_model", "eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "03eccd6b65a33817b12bd12bca058bbadecfc1ff4fabad1ca3e48b91f50cfe78"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "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, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": "claims_data_model://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}, "database": "tuva", "schema": "claims_data_model"}, "created_at": 1694466126.4015856, "relation_name": "tuva.claims_data_model.eligibility", "raw_code": "select 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\nfrom tuva.tuva_synthetic.eligibility_seed", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\eligibility.sql", "compiled": true, "compiled_code": "select 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\nfrom tuva.tuva_synthetic.eligibility_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.encounter": {"database": "tuva", "schema": "claims_data_model", "name": "encounter", "resource_type": "model", "package_name": "claims_data_model", "path": "encounter.sql", "original_file_path": "models\\encounter.sql", "unique_id": "model.claims_data_model.encounter", "fqn": ["claims_data_model", "encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "38386f9be56e5a690a7c6f584f1bbc41f291fa78751073ab2e07c29888003e3b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3764696, "relation_name": "tuva.claims_data_model.encounter", "raw_code": "select \r\nnull as encounter_id\r\n, null as patient_id\r\n, null as encounter_type\r\n, null as encounter_start_date\r\n, null as encounter_end_date\r\n, null as length_of_stay\r\n, null as admit_source_code\r\n, null as admit_source_description\r\n, null as admit_type_code\r\n, null as admit_type_description\r\n, null as discharge_disposition_code\r\n, null as discharge_disposition_description\r\n, null as attending_provider_id\r\n, null as facility_npi\r\n, null as primary_diagnosis_code\r\n, null as primary_diagnosis_description\r\n, null as ms_drg_code\r\n, null as ms_drg_description\r\n, null as apr_drg_code\r\n, null as apr_drg_description\r\n, null as paid_amount\r\n, null as allowed_amount\r\n, null as charge_amount\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\encounter.sql", "compiled": true, "compiled_code": "select \r\nnull as encounter_id\r\n, null as patient_id\r\n, null as encounter_type\r\n, null as encounter_start_date\r\n, null as encounter_end_date\r\n, null as length_of_stay\r\n, null as admit_source_code\r\n, null as admit_source_description\r\n, null as admit_type_code\r\n, null as admit_type_description\r\n, null as discharge_disposition_code\r\n, null as discharge_disposition_description\r\n, null as attending_provider_id\r\n, null as facility_npi\r\n, null as primary_diagnosis_code\r\n, null as primary_diagnosis_description\r\n, null as ms_drg_code\r\n, null as ms_drg_description\r\n, null as apr_drg_code\r\n, null as apr_drg_description\r\n, null as paid_amount\r\n, null as allowed_amount\r\n, null as charge_amount\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.lab_result": {"database": "tuva", "schema": "claims_data_model", "name": "lab_result", "resource_type": "model", "package_name": "claims_data_model", "path": "lab_result.sql", "original_file_path": "models\\lab_result.sql", "unique_id": "model.claims_data_model.lab_result", "fqn": ["claims_data_model", "lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "9998c0505ce23ff3469bfacc8153b9bfb16b44c1735cb90d2e616cef699876ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.379005, "relation_name": "tuva.claims_data_model.lab_result", "raw_code": "select\r\nnull as lab_result_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as accession_number\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as source_component\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as normalized_component\r\n, null as status\r\n, null as result\r\n, null as result_date\r\n, null as collection_date\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as source_abnormal_flag\r\n, null as normalized_abnormal_flag\r\n, null as specimen\r\n, null as ordering_practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\lab_result.sql", "compiled": true, "compiled_code": "select\r\nnull as lab_result_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as accession_number\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as source_component\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as normalized_component\r\n, null as status\r\n, null as result\r\n, null as result_date\r\n, null as collection_date\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as source_abnormal_flag\r\n, null as normalized_abnormal_flag\r\n, null as specimen\r\n, null as ordering_practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.location": {"database": "tuva", "schema": "claims_data_model", "name": "location", "resource_type": "model", "package_name": "claims_data_model", "path": "location.sql", "original_file_path": "models\\location.sql", "unique_id": "model.claims_data_model.location", "fqn": ["claims_data_model", "location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "eeee0dcfdadf4886cb8af774bf81be2c5d9812765e5b6e3d047d85efd825a15e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3806524, "relation_name": "tuva.claims_data_model.location", "raw_code": "select\r\nnull as location_id\r\n, null as npi\r\n, null as name\r\n, null as facility_type\r\n, null as parent_organization\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\location.sql", "compiled": true, "compiled_code": "select\r\nnull as location_id\r\n, null as npi\r\n, null as name\r\n, null as facility_type\r\n, null as parent_organization\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.medical_claim": {"database": "tuva", "schema": "claims_data_model", "name": "medical_claim", "resource_type": "model", "package_name": "claims_data_model", "path": "medical_claim.sql", "original_file_path": "models\\medical_claim.sql", "unique_id": "model.claims_data_model.medical_claim", "fqn": ["claims_data_model", "medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "362a3508c230325aa78a87b1c04b5e9999374a2c132b816889e73ad5ebb9d40b"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "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, "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", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "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", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total cost of care for a claim from all payment sources (e.g. primary, beneficiary, third-party, etc)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_type": {"name": "diagnosis_code_type", "description": "Indicates the type of diagnosis code (e.g. ICD-10-CM).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": "claims_data_model://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}, "database": "tuva", "schema": "claims_data_model"}, "created_at": 1694466126.4539745, "relation_name": "tuva.claims_data_model.medical_claim", "raw_code": "select claim_id,\r\n claim_line_number,\r\n claim_type,\r\n patient_id,\r\n member_id,\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 total_cost_amount,\r\n allowed_amount,\r\n charge_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 tuva.tuva_synthetic.medical_claim_seed", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\medical_claim.sql", "compiled": true, "compiled_code": "select claim_id,\r\n claim_line_number,\r\n claim_type,\r\n patient_id,\r\n member_id,\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 total_cost_amount,\r\n allowed_amount,\r\n charge_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 tuva.tuva_synthetic.medical_claim_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.medication": {"database": "tuva", "schema": "claims_data_model", "name": "medication", "resource_type": "model", "package_name": "claims_data_model", "path": "medication.sql", "original_file_path": "models\\medication.sql", "unique_id": "model.claims_data_model.medication", "fqn": ["claims_data_model", "medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "7acf73c9e0217dcf225055541370a005516a33ddb58eee3395d952bc6114e23c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3846629, "relation_name": "tuva.claims_data_model.medication", "raw_code": "select \r\nnull as medication_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as dispensing_date\r\n, null as prescribing_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as ndc_code\r\n, null as ndc_description\r\n, null as rxnorm_code\r\n, null as rxnorm_description\r\n, null as atc_code\r\n, null as atc_description\r\n, null as route\r\n, null as strength\r\n, null as quantity\r\n, null as quantity_unit\r\n, null as days_supply\r\n, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\medication.sql", "compiled": true, "compiled_code": "select \r\nnull as medication_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as dispensing_date\r\n, null as prescribing_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as ndc_code\r\n, null as ndc_description\r\n, null as rxnorm_code\r\n, null as rxnorm_description\r\n, null as atc_code\r\n, null as atc_description\r\n, null as route\r\n, null as strength\r\n, null as quantity\r\n, null as quantity_unit\r\n, null as days_supply\r\n, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.observation": {"database": "tuva", "schema": "claims_data_model", "name": "observation", "resource_type": "model", "package_name": "claims_data_model", "path": "observation.sql", "original_file_path": "models\\observation.sql", "unique_id": "model.claims_data_model.observation", "fqn": ["claims_data_model", "observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "707f27181f1bc61f20b3ccf4d69e389ec204f33765a5043ccd81be9c5fd3958a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3872488, "relation_name": "tuva.claims_data_model.observation", "raw_code": "select\r\nnull as observation_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as panel_id\r\n, null as observation_date\r\n, null as observation_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as result\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\observation.sql", "compiled": true, "compiled_code": "select\r\nnull as observation_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as panel_id\r\n, null as observation_date\r\n, null as observation_type\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\r\n, null as result\r\n, null as source_units\r\n, null as normalized_units\r\n, null as source_reference_range_low\r\n, null as source_reference_range_high\r\n, null as normalized_reference_range_low\r\n, null as normalized_reference_range_high\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.patient": {"database": "tuva", "schema": "claims_data_model", "name": "patient", "resource_type": "model", "package_name": "claims_data_model", "path": "patient.sql", "original_file_path": "models\\patient.sql", "unique_id": "model.claims_data_model.patient", "fqn": ["claims_data_model", "patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "cf0d0f18e6030b9b9039410efcb37d66623b3ac5b1c91e210944828b66268bd3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3882458, "relation_name": "tuva.claims_data_model.patient", "raw_code": "select\r\nnull as patient_id\r\n, null as first_name\r\n, null as last_name\r\n, null as sex\r\n, null as race\r\n, null as birth_date\r\n, null as death_date\r\n, null as death_flag\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as county\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\patient.sql", "compiled": true, "compiled_code": "select\r\nnull as patient_id\r\n, null as first_name\r\n, null as last_name\r\n, null as sex\r\n, null as race\r\n, null as birth_date\r\n, null as death_date\r\n, null as death_flag\r\n, null as address\r\n, null as city\r\n, null as state\r\n, null as zip_code\r\n, null as county\r\n, null as latitude\r\n, null as longitude\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.pharmacy_claim": {"database": "tuva", "schema": "claims_data_model", "name": "pharmacy_claim", "resource_type": "model", "package_name": "claims_data_model", "path": "pharmacy_claim.sql", "original_file_path": "models\\pharmacy_claim.sql", "unique_id": "model.claims_data_model.pharmacy_claim", "fqn": ["claims_data_model", "pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "314a89f6ab7d2692cb6382cc4d6c33c8c9022365dda079ba76f6bd8b85d44229"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "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, "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", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "/terminology/medications/ndc"}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": "claims_data_model://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}, "database": "tuva", "schema": "claims_data_model"}, "created_at": 1694466126.4609168, "relation_name": "tuva.claims_data_model.pharmacy_claim", "raw_code": "select claim_id,\r\n claim_line_number,\r\n patient_id,\r\n member_id,\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\nfrom tuva.tuva_synthetic.pharmacy_claim_seed", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\pharmacy_claim.sql", "compiled": true, "compiled_code": "select claim_id,\r\n claim_line_number,\r\n patient_id,\r\n member_id,\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\nfrom tuva.tuva_synthetic.pharmacy_claim_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.practitioner": {"database": "tuva", "schema": "claims_data_model", "name": "practitioner", "resource_type": "model", "package_name": "claims_data_model", "path": "practitioner.sql", "original_file_path": "models\\practitioner.sql", "unique_id": "model.claims_data_model.practitioner", "fqn": ["claims_data_model", "practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "2735d624387e23bf87c3a1ee99e2912d3bf208e11aae80b379d67db7cb16572a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3923314, "relation_name": "tuva.claims_data_model.practitioner", "raw_code": "select\r\n null as practitioner_id\r\n, null as npi\r\n, null as first_name\r\n, null as last_name\r\n, null as practice_affiliation\r\n, null as specialty\r\n, null as sub_specialty\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\practitioner.sql", "compiled": true, "compiled_code": "select\r\n null as practitioner_id\r\n, null as npi\r\n, null as first_name\r\n, null as last_name\r\n, null as practice_affiliation\r\n, null as specialty\r\n, null as sub_specialty\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.claims_data_model.procedure": {"database": "tuva", "schema": "claims_data_model", "name": "procedure", "resource_type": "model", "package_name": "claims_data_model", "path": "procedure.sql", "original_file_path": "models\\procedure.sql", "unique_id": "model.claims_data_model.procedure", "fqn": ["claims_data_model", "procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "2c6aeaae8674f72dd4616bdec602f57c645cdf7fd74595b41b1c9cc82a260369"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "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": "#1a0707"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#1a0707"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "materialized": "view", "docs": {"node_color": "#1a0707"}}, "created_at": 1694466124.3933027, "relation_name": "tuva.claims_data_model.procedure", "raw_code": "select\r\n null as procedure_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as procedure_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\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, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "../target\\compiled\\claims_data_model\\models\\procedure.sql", "compiled": true, "compiled_code": "select\r\n null as procedure_id\r\n, null as patient_id\r\n, null as encounter_id\r\n, null as claim_id\r\n, null as procedure_date\r\n, null as source_code_type\r\n, null as source_code\r\n, null as source_description\r\n, null as normalized_code_type\r\n, null as normalized_code\r\n, null as normalized_description\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, null as practitioner_id\r\n, null as data_source\r\n, null as tuva_last_run\r\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "seed.claims_data_model.eligibility_seed": {"database": "tuva", "schema": "tuva_synthetic", "name": "eligibility_seed", "resource_type": "seed", "package_name": "claims_data_model", "path": "eligibility_seed.csv", "original_file_path": "../seeds\\eligibility_seed.csv", "unique_id": "seed.claims_data_model.eligibility_seed", "fqn": ["claims_data_model", "eligibility_seed"], "alias": "eligibility_seed", "checksum": {"name": "sha256", "checksum": "382ddb9efd9cc0deeda2147c03688e4c62f765a2f0a46b1997e398521615415d"}, "config": {"enabled": true, "alias": null, "schema": "tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"patient_id": "varchar(255)", "member_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)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "claims_data_model://../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)", "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)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1694466126.3138254, "relation_name": "tuva.tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.claims_data_model.medical_claim_seed": {"database": "tuva", "schema": "tuva_synthetic", "name": "medical_claim_seed", "resource_type": "seed", "package_name": "claims_data_model", "path": "medical_claim_seed.csv", "original_file_path": "../seeds\\medical_claim_seed.csv", "unique_id": "seed.claims_data_model.medical_claim_seed", "fqn": ["claims_data_model", "medical_claim_seed"], "alias": "medical_claim_seed", "checksum": {"name": "sha256", "checksum": "df34eb4faa196ea5362a782a15975bd2e530678d369b8598e6ea95f1804095e8"}, "config": {"enabled": true, "alias": null, "schema": "tuva_synthetic", "database": null, "tags": [], "meta": {}, "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)", "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", "total_cost_amount": "float", "allowed_amount": "float", "charge_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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "claims_data_model://../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)", "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", "total_cost_amount": "float", "allowed_amount": "float", "charge_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": 1694466126.3854206, "relation_name": "tuva.tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.claims_data_model.pharmacy_claim_seed": {"database": "tuva", "schema": "tuva_synthetic", "name": "pharmacy_claim_seed", "resource_type": "seed", "package_name": "claims_data_model", "path": "pharmacy_claim_seed.csv", "original_file_path": "../seeds\\pharmacy_claim_seed.csv", "unique_id": "seed.claims_data_model.pharmacy_claim_seed", "fqn": ["claims_data_model", "pharmacy_claim_seed"], "alias": "pharmacy_claim_seed", "checksum": {"name": "sha256", "checksum": "4b4eced3793f948cd0cbcb1a3d690a445e3c0c2def94fb5b58a41d30df1843b6"}, "config": {"enabled": true, "alias": null, "schema": "tuva_synthetic", "database": null, "tags": [], "meta": {}, "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)", "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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "claims_data_model://../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)", "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": 1694466126.3939998, "relation_name": "tuva.tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "tuva", "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": "7be895f0727a7cac40282430cf8b0e66baa1b2443ed8d72118b007e8f5197bcb"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "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, "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, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.4803257, "relation_name": "tuva.ccsr.long_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__dx_vertical_pivot"], ["ccsr__stg_core__condition"], ["ccsr__dxccsr_v2023_1_body_systems"]], "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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n),ccsr__dx_vertical_pivot as (\n \n select * from tuva.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 tuva.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 '2023-09-12 13:15:18.296145+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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}]}, "model.the_tuva_project.ccsr__long_procedure_category": {"database": "tuva", "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": "37a1eb025704337c20c1dc6f8262ed0a56ec46691ee117cd1c8846ff2af3319e"}, "config": {"enabled": true, "alias": "long_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.4956498, "relation_name": "tuva.ccsr.long_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__stg_core__procedure"], ["ccsr__procedure_category_map"]], "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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 tuva.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 '2023-09-12 13:15:18.296145+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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "tuva", "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": "652fe2547dc8097460a36e86897ad8d57c78a8deb15bcbb906b03b0a5a89480a"}, "config": {"enabled": true, "alias": "singular_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.4900572, "relation_name": "tuva.ccsr.singular_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__long_condition_category"]], "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 '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.ccsr.long_condition_category\nwhere \n is_ip_default_category = true\n and condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__wide_condition_category": {"database": "tuva", "schema": "ccsr", "name": "ccsr__wide_condition_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__wide_condition_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__wide_condition_category.sql", "unique_id": "model.the_tuva_project.ccsr__wide_condition_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__wide_condition_category"], "alias": "wide_condition_category", "checksum": {"name": "sha256", "checksum": "dbc8a89328448d2913c1bf47aa1033a66c13f3504ab692132ef4a50992b60154"}, "config": {"enabled": true, "alias": "wide_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a row for each input record with a column for every CCSR condition category. \nEach column contains a value of 0, 1, 2, or 3. These values indicate:\n * 0 \\- The CCSR was not triggered by any ICD-10-CM diagnosis code on the input record.\n * 1 \\- The CCSR was triggered by only the principal (or first-listed) diagnosis on the input record.\n * 2 \\- The CCSR was triggered by both the principal (or first-listed) diagnosis and any secondary diagnosis on the input record.\n * 3 \\- The CCSR was triggered by only secondary diagnosis code(s) on the input record.\n\n This table doesn't include any category descriptions, but category and parent category descriptions\n can be found by querying the target column name against the `ccsr__dx_vertical_pivot` intermediate model. \n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "wide_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466126.4853077, "relation_name": "tuva.ccsr.wide_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set categories_list = dbt_utils.get_column_values(\r\n table=ref(\"ccsr__dx_vertical_pivot\"),\r\n column=\"ccsr_category\",\r\n order_by=\"ccsr_category\"\r\n) %}\r\n\r\n\r\nwith bool_ranks as (\r\n\r\n -- bool agg functions will reduce the long table to one row per CCSR category per encounter\r\n select \r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n case when ccsr_category like 'XXX%' then 1 else 0 end as is_excluded,\r\n min(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_only_first,\r\n max(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_first,\r\n max(cast(case when condition_rank >= 1 then 1 else 0 end as int)) as is_nth,\r\n max(cast(case when condition_rank > 1 then 1 else 0 end as int)) as not_first\r\n from {{ ref('ccsr__long_condition_category') }}\r\n {{ dbt_utils.group_by(n=5) }}\r\n\r\n), bool_logic as (\r\n\r\n select distinct\r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n -- assigns one of four values for each DXCCSR data element as per pg 25 of DXCCSR User guide v2023.1\r\n case \r\n when is_nth = 0 then 0\r\n when is_only_first = 1 and is_excluded = 0 then 1\r\n when is_first = 1 and is_nth = 1 and is_excluded = 0 then 2\r\n when not_first = 1 then 3 \r\n else -99 \r\n end as dx_code\r\n from bool_ranks \r\n\r\n)\r\n\r\nselect distinct\r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n -- pivot rows into column values for each possible CCSR category\r\n {% for category in categories_list %}\r\n sum(case when ccsr_category = '{{ category }}' then dx_code else 0 end) as dxccsr_{{ category }},\r\n {% endfor %}\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom bool_logic\r\ngroup by encounter_id, claim_id, patient_id, dxccsr_version, tuva_last_run", "language": "sql", "refs": [["ccsr__dx_vertical_pivot"], ["ccsr__long_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.group_by"], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__wide_condition_category.sql", "compiled": true, "compiled_code": "\n\n\n\n\nwith bool_ranks as (\n\n -- bool agg functions will reduce the long table to one row per CCSR category per encounter\n select \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n case when ccsr_category like 'XXX%' then 1 else 0 end as is_excluded,\n min(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_only_first,\n max(cast(case when condition_rank = 1 then 1 else 0 end as int)) as is_first,\n max(cast(case when condition_rank >= 1 then 1 else 0 end as int)) as is_nth,\n max(cast(case when condition_rank > 1 then 1 else 0 end as int)) as not_first\n from tuva.ccsr.long_condition_category\n group by 1,2,3,4,5\n\n), bool_logic as (\n\n select distinct\n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n -- assigns one of four values for each DXCCSR data element as per pg 25 of DXCCSR User guide v2023.1\n case \n when is_nth = 0 then 0\n when is_only_first = 1 and is_excluded = 0 then 1\n when is_first = 1 and is_nth = 1 and is_excluded = 0 then 2\n when not_first = 1 then 3 \n else -99 \n end as dx_code\n from bool_ranks \n\n)\n\nselect distinct\n encounter_id,\n claim_id,\n patient_id,\n -- pivot rows into column values for each possible CCSR category\n \n sum(case when ccsr_category = 'BLD001' then dx_code else 0 end) as dxccsr_BLD001,\n \n sum(case when ccsr_category = 'BLD002' then dx_code else 0 end) as dxccsr_BLD002,\n \n sum(case when ccsr_category = 'BLD003' then dx_code else 0 end) as dxccsr_BLD003,\n \n sum(case when ccsr_category = 'BLD004' then dx_code else 0 end) as dxccsr_BLD004,\n \n sum(case when ccsr_category = 'BLD005' then dx_code else 0 end) as dxccsr_BLD005,\n \n sum(case when ccsr_category = 'BLD006' then dx_code else 0 end) as dxccsr_BLD006,\n \n sum(case when ccsr_category = 'BLD007' then dx_code else 0 end) as dxccsr_BLD007,\n \n sum(case when ccsr_category = 'BLD008' then dx_code else 0 end) as dxccsr_BLD008,\n \n sum(case when ccsr_category = 'BLD009' then dx_code else 0 end) as dxccsr_BLD009,\n \n sum(case when ccsr_category = 'BLD010' then dx_code else 0 end) as dxccsr_BLD010,\n \n sum(case when ccsr_category = 'CIR001' then dx_code else 0 end) as dxccsr_CIR001,\n \n sum(case when ccsr_category = 'CIR002' then dx_code else 0 end) as dxccsr_CIR002,\n \n sum(case when ccsr_category = 'CIR003' then dx_code else 0 end) as dxccsr_CIR003,\n \n sum(case when ccsr_category = 'CIR004' then dx_code else 0 end) as dxccsr_CIR004,\n \n sum(case when ccsr_category = 'CIR005' then dx_code else 0 end) as dxccsr_CIR005,\n \n sum(case when ccsr_category = 'CIR006' then dx_code else 0 end) as dxccsr_CIR006,\n \n sum(case when ccsr_category = 'CIR007' then dx_code else 0 end) as dxccsr_CIR007,\n \n sum(case when ccsr_category = 'CIR008' then dx_code else 0 end) as dxccsr_CIR008,\n \n sum(case when ccsr_category = 'CIR009' then dx_code else 0 end) as dxccsr_CIR009,\n \n sum(case when ccsr_category = 'CIR010' then dx_code else 0 end) as dxccsr_CIR010,\n \n sum(case when ccsr_category = 'CIR011' then dx_code else 0 end) as dxccsr_CIR011,\n \n sum(case when ccsr_category = 'CIR012' then dx_code else 0 end) as dxccsr_CIR012,\n \n sum(case when ccsr_category = 'CIR013' then dx_code else 0 end) as dxccsr_CIR013,\n \n sum(case when ccsr_category = 'CIR014' then dx_code else 0 end) as dxccsr_CIR014,\n \n sum(case when ccsr_category = 'CIR015' then dx_code else 0 end) as dxccsr_CIR015,\n \n sum(case when ccsr_category = 'CIR016' then dx_code else 0 end) as dxccsr_CIR016,\n \n sum(case when ccsr_category = 'CIR017' then dx_code else 0 end) as dxccsr_CIR017,\n \n sum(case when ccsr_category = 'CIR018' then dx_code else 0 end) as dxccsr_CIR018,\n \n sum(case when ccsr_category = 'CIR019' then dx_code else 0 end) as dxccsr_CIR019,\n \n sum(case when ccsr_category = 'CIR020' then dx_code else 0 end) as dxccsr_CIR020,\n \n sum(case when ccsr_category = 'CIR021' then dx_code else 0 end) as dxccsr_CIR021,\n \n sum(case when ccsr_category = 'CIR022' then dx_code else 0 end) as dxccsr_CIR022,\n \n sum(case when ccsr_category = 'CIR023' then dx_code else 0 end) as dxccsr_CIR023,\n \n sum(case when ccsr_category = 'CIR024' then dx_code else 0 end) as dxccsr_CIR024,\n \n sum(case when ccsr_category = 'CIR025' then dx_code else 0 end) as dxccsr_CIR025,\n \n sum(case when ccsr_category = 'CIR026' then dx_code else 0 end) as dxccsr_CIR026,\n \n sum(case when ccsr_category = 'CIR027' then dx_code else 0 end) as dxccsr_CIR027,\n \n sum(case when ccsr_category = 'CIR028' then dx_code else 0 end) as dxccsr_CIR028,\n \n sum(case when ccsr_category = 'CIR029' then dx_code else 0 end) as dxccsr_CIR029,\n \n sum(case when ccsr_category = 'CIR030' then dx_code else 0 end) as dxccsr_CIR030,\n \n sum(case when ccsr_category = 'CIR031' then dx_code else 0 end) as dxccsr_CIR031,\n \n sum(case when ccsr_category = 'CIR032' then dx_code else 0 end) as dxccsr_CIR032,\n \n sum(case when ccsr_category = 'CIR033' then dx_code else 0 end) as dxccsr_CIR033,\n \n sum(case when ccsr_category = 'CIR034' then dx_code else 0 end) as dxccsr_CIR034,\n \n sum(case when ccsr_category = 'CIR035' then dx_code else 0 end) as dxccsr_CIR035,\n \n sum(case when ccsr_category = 'CIR036' then dx_code else 0 end) as dxccsr_CIR036,\n \n sum(case when ccsr_category = 'CIR037' then dx_code else 0 end) as dxccsr_CIR037,\n \n sum(case when ccsr_category = 'CIR038' then dx_code else 0 end) as dxccsr_CIR038,\n \n sum(case when ccsr_category = 'CIR039' then dx_code else 0 end) as dxccsr_CIR039,\n \n sum(case when ccsr_category = 'DEN001' then dx_code else 0 end) as dxccsr_DEN001,\n \n sum(case when ccsr_category = 'DEN002' then dx_code else 0 end) as dxccsr_DEN002,\n \n sum(case when ccsr_category = 'DEN003' then dx_code else 0 end) as dxccsr_DEN003,\n \n sum(case when ccsr_category = 'DIG001' then dx_code else 0 end) as dxccsr_DIG001,\n \n sum(case when ccsr_category = 'DIG002' then dx_code else 0 end) as dxccsr_DIG002,\n \n sum(case when ccsr_category = 'DIG003' then dx_code else 0 end) as dxccsr_DIG003,\n \n sum(case when ccsr_category = 'DIG004' then dx_code else 0 end) as dxccsr_DIG004,\n \n sum(case when ccsr_category = 'DIG005' then dx_code else 0 end) as dxccsr_DIG005,\n \n sum(case when ccsr_category = 'DIG006' then dx_code else 0 end) as dxccsr_DIG006,\n \n sum(case when ccsr_category = 'DIG007' then dx_code else 0 end) as dxccsr_DIG007,\n \n sum(case when ccsr_category = 'DIG008' then dx_code else 0 end) as dxccsr_DIG008,\n \n sum(case when ccsr_category = 'DIG009' then dx_code else 0 end) as dxccsr_DIG009,\n \n sum(case when ccsr_category = 'DIG010' then dx_code else 0 end) as dxccsr_DIG010,\n \n sum(case when ccsr_category = 'DIG011' then dx_code else 0 end) as dxccsr_DIG011,\n \n sum(case when ccsr_category = 'DIG012' then dx_code else 0 end) as dxccsr_DIG012,\n \n sum(case when ccsr_category = 'DIG013' then dx_code else 0 end) as dxccsr_DIG013,\n \n sum(case when ccsr_category = 'DIG014' then dx_code else 0 end) as dxccsr_DIG014,\n \n sum(case when ccsr_category = 'DIG015' then dx_code else 0 end) as dxccsr_DIG015,\n \n sum(case when ccsr_category = 'DIG016' then dx_code else 0 end) as dxccsr_DIG016,\n \n sum(case when ccsr_category = 'DIG017' then dx_code else 0 end) as dxccsr_DIG017,\n \n sum(case when ccsr_category = 'DIG018' then dx_code else 0 end) as dxccsr_DIG018,\n \n sum(case when ccsr_category = 'DIG019' then dx_code else 0 end) as dxccsr_DIG019,\n \n sum(case when ccsr_category = 'DIG020' then dx_code else 0 end) as dxccsr_DIG020,\n \n sum(case when ccsr_category = 'DIG021' then dx_code else 0 end) as dxccsr_DIG021,\n \n sum(case when ccsr_category = 'DIG022' then dx_code else 0 end) as dxccsr_DIG022,\n \n sum(case when ccsr_category = 'DIG023' then dx_code else 0 end) as dxccsr_DIG023,\n \n sum(case when ccsr_category = 'DIG024' then dx_code else 0 end) as dxccsr_DIG024,\n \n sum(case when ccsr_category = 'DIG025' then dx_code else 0 end) as dxccsr_DIG025,\n \n sum(case when ccsr_category = 'EAR001' then dx_code else 0 end) as dxccsr_EAR001,\n \n sum(case when ccsr_category = 'EAR002' then dx_code else 0 end) as dxccsr_EAR002,\n \n sum(case when ccsr_category = 'EAR003' then dx_code else 0 end) as dxccsr_EAR003,\n \n sum(case when ccsr_category = 'EAR004' then dx_code else 0 end) as dxccsr_EAR004,\n \n sum(case when ccsr_category = 'EAR005' then dx_code else 0 end) as dxccsr_EAR005,\n \n sum(case when ccsr_category = 'EAR006' then dx_code else 0 end) as dxccsr_EAR006,\n \n sum(case when ccsr_category = 'END001' then dx_code else 0 end) as dxccsr_END001,\n \n sum(case when ccsr_category = 'END002' then dx_code else 0 end) as dxccsr_END002,\n \n sum(case when ccsr_category = 'END003' then dx_code else 0 end) as dxccsr_END003,\n \n sum(case when ccsr_category = 'END004' then dx_code else 0 end) as dxccsr_END004,\n \n sum(case when ccsr_category = 'END005' then dx_code else 0 end) as dxccsr_END005,\n \n sum(case when ccsr_category = 'END006' then dx_code else 0 end) as dxccsr_END006,\n \n sum(case when ccsr_category = 'END007' then dx_code else 0 end) as dxccsr_END007,\n \n sum(case when ccsr_category = 'END008' then dx_code else 0 end) as dxccsr_END008,\n \n sum(case when ccsr_category = 'END009' then dx_code else 0 end) as dxccsr_END009,\n \n sum(case when ccsr_category = 'END010' then dx_code else 0 end) as dxccsr_END010,\n \n sum(case when ccsr_category = 'END011' then dx_code else 0 end) as dxccsr_END011,\n \n sum(case when ccsr_category = 'END012' then dx_code else 0 end) as dxccsr_END012,\n \n sum(case when ccsr_category = 'END013' then dx_code else 0 end) as dxccsr_END013,\n \n sum(case when ccsr_category = 'END014' then dx_code else 0 end) as dxccsr_END014,\n \n sum(case when ccsr_category = 'END015' then dx_code else 0 end) as dxccsr_END015,\n \n sum(case when ccsr_category = 'END016' then dx_code else 0 end) as dxccsr_END016,\n \n sum(case when ccsr_category = 'END017' then dx_code else 0 end) as dxccsr_END017,\n \n sum(case when ccsr_category = 'EXT001' then dx_code else 0 end) as dxccsr_EXT001,\n \n sum(case when ccsr_category = 'EXT002' then dx_code else 0 end) as dxccsr_EXT002,\n \n sum(case when ccsr_category = 'EXT003' then dx_code else 0 end) as dxccsr_EXT003,\n \n sum(case when ccsr_category = 'EXT004' then dx_code else 0 end) as dxccsr_EXT004,\n \n sum(case when ccsr_category = 'EXT005' then dx_code else 0 end) as dxccsr_EXT005,\n \n sum(case when ccsr_category = 'EXT006' then dx_code else 0 end) as dxccsr_EXT006,\n \n sum(case when ccsr_category = 'EXT007' then dx_code else 0 end) as dxccsr_EXT007,\n \n sum(case when ccsr_category = 'EXT008' then dx_code else 0 end) as dxccsr_EXT008,\n \n sum(case when ccsr_category = 'EXT009' then dx_code else 0 end) as dxccsr_EXT009,\n \n sum(case when ccsr_category = 'EXT010' then dx_code else 0 end) as dxccsr_EXT010,\n \n sum(case when ccsr_category = 'EXT011' then dx_code else 0 end) as dxccsr_EXT011,\n \n sum(case when ccsr_category = 'EXT012' then dx_code else 0 end) as dxccsr_EXT012,\n \n sum(case when ccsr_category = 'EXT013' then dx_code else 0 end) as dxccsr_EXT013,\n \n sum(case when ccsr_category = 'EXT014' then dx_code else 0 end) as dxccsr_EXT014,\n \n sum(case when ccsr_category = 'EXT015' then dx_code else 0 end) as dxccsr_EXT015,\n \n sum(case when ccsr_category = 'EXT016' then dx_code else 0 end) as dxccsr_EXT016,\n \n sum(case when ccsr_category = 'EXT017' then dx_code else 0 end) as dxccsr_EXT017,\n \n sum(case when ccsr_category = 'EXT018' then dx_code else 0 end) as dxccsr_EXT018,\n \n sum(case when ccsr_category = 'EXT019' then dx_code else 0 end) as dxccsr_EXT019,\n \n sum(case when ccsr_category = 'EXT020' then dx_code else 0 end) as dxccsr_EXT020,\n \n sum(case when ccsr_category = 'EXT021' then dx_code else 0 end) as dxccsr_EXT021,\n \n sum(case when ccsr_category = 'EXT022' then dx_code else 0 end) as dxccsr_EXT022,\n \n sum(case when ccsr_category = 'EXT023' then dx_code else 0 end) as dxccsr_EXT023,\n \n sum(case when ccsr_category = 'EXT024' then dx_code else 0 end) as dxccsr_EXT024,\n \n sum(case when ccsr_category = 'EXT025' then dx_code else 0 end) as dxccsr_EXT025,\n \n sum(case when ccsr_category = 'EXT026' then dx_code else 0 end) as dxccsr_EXT026,\n \n sum(case when ccsr_category = 'EXT027' then dx_code else 0 end) as dxccsr_EXT027,\n \n sum(case when ccsr_category = 'EXT028' then dx_code else 0 end) as dxccsr_EXT028,\n \n sum(case when ccsr_category = 'EXT029' then dx_code else 0 end) as dxccsr_EXT029,\n \n sum(case when ccsr_category = 'EXT030' then dx_code else 0 end) as dxccsr_EXT030,\n \n sum(case when ccsr_category = 'EYE001' then dx_code else 0 end) as dxccsr_EYE001,\n \n sum(case when ccsr_category = 'EYE002' then dx_code else 0 end) as dxccsr_EYE002,\n \n sum(case when ccsr_category = 'EYE003' then dx_code else 0 end) as dxccsr_EYE003,\n \n sum(case when ccsr_category = 'EYE004' then dx_code else 0 end) as dxccsr_EYE004,\n \n sum(case when ccsr_category = 'EYE005' then dx_code else 0 end) as dxccsr_EYE005,\n \n sum(case when ccsr_category = 'EYE006' then dx_code else 0 end) as dxccsr_EYE006,\n \n sum(case when ccsr_category = 'EYE007' then dx_code else 0 end) as dxccsr_EYE007,\n \n sum(case when ccsr_category = 'EYE008' then dx_code else 0 end) as dxccsr_EYE008,\n \n sum(case when ccsr_category = 'EYE009' then dx_code else 0 end) as dxccsr_EYE009,\n \n sum(case when ccsr_category = 'EYE010' then dx_code else 0 end) as dxccsr_EYE010,\n \n sum(case when ccsr_category = 'EYE011' then dx_code else 0 end) as dxccsr_EYE011,\n \n sum(case when ccsr_category = 'EYE012' then dx_code else 0 end) as dxccsr_EYE012,\n \n sum(case when ccsr_category = 'FAC001' then dx_code else 0 end) as dxccsr_FAC001,\n \n sum(case when ccsr_category = 'FAC002' then dx_code else 0 end) as dxccsr_FAC002,\n \n sum(case when ccsr_category = 'FAC003' then dx_code else 0 end) as dxccsr_FAC003,\n \n sum(case when ccsr_category = 'FAC004' then dx_code else 0 end) as dxccsr_FAC004,\n \n sum(case when ccsr_category = 'FAC005' then dx_code else 0 end) as dxccsr_FAC005,\n \n sum(case when ccsr_category = 'FAC006' then dx_code else 0 end) as dxccsr_FAC006,\n \n sum(case when ccsr_category = 'FAC007' then dx_code else 0 end) as dxccsr_FAC007,\n \n sum(case when ccsr_category = 'FAC008' then dx_code else 0 end) as dxccsr_FAC008,\n \n sum(case when ccsr_category = 'FAC009' then dx_code else 0 end) as dxccsr_FAC009,\n \n sum(case when ccsr_category = 'FAC010' then dx_code else 0 end) as dxccsr_FAC010,\n \n sum(case when ccsr_category = 'FAC011' then dx_code else 0 end) as dxccsr_FAC011,\n \n sum(case when ccsr_category = 'FAC012' then dx_code else 0 end) as dxccsr_FAC012,\n \n sum(case when ccsr_category = 'FAC013' then dx_code else 0 end) as dxccsr_FAC013,\n \n sum(case when ccsr_category = 'FAC014' then dx_code else 0 end) as dxccsr_FAC014,\n \n sum(case when ccsr_category = 'FAC015' then dx_code else 0 end) as dxccsr_FAC015,\n \n sum(case when ccsr_category = 'FAC016' then dx_code else 0 end) as dxccsr_FAC016,\n \n sum(case when ccsr_category = 'FAC017' then dx_code else 0 end) as dxccsr_FAC017,\n \n sum(case when ccsr_category = 'FAC018' then dx_code else 0 end) as dxccsr_FAC018,\n \n sum(case when ccsr_category = 'FAC019' then dx_code else 0 end) as dxccsr_FAC019,\n \n sum(case when ccsr_category = 'FAC020' then dx_code else 0 end) as dxccsr_FAC020,\n \n sum(case when ccsr_category = 'FAC021' then dx_code else 0 end) as dxccsr_FAC021,\n \n sum(case when ccsr_category = 'FAC022' then dx_code else 0 end) as dxccsr_FAC022,\n \n sum(case when ccsr_category = 'FAC023' then dx_code else 0 end) as dxccsr_FAC023,\n \n sum(case when ccsr_category = 'FAC024' then dx_code else 0 end) as dxccsr_FAC024,\n \n sum(case when ccsr_category = 'FAC025' then dx_code else 0 end) as dxccsr_FAC025,\n \n sum(case when ccsr_category = 'GEN001' then dx_code else 0 end) as dxccsr_GEN001,\n \n sum(case when ccsr_category = 'GEN002' then dx_code else 0 end) as dxccsr_GEN002,\n \n sum(case when ccsr_category = 'GEN003' then dx_code else 0 end) as dxccsr_GEN003,\n \n sum(case when ccsr_category = 'GEN004' then dx_code else 0 end) as dxccsr_GEN004,\n \n sum(case when ccsr_category = 'GEN005' then dx_code else 0 end) as dxccsr_GEN005,\n \n sum(case when ccsr_category = 'GEN006' then dx_code else 0 end) as dxccsr_GEN006,\n \n sum(case when ccsr_category = 'GEN007' then dx_code else 0 end) as dxccsr_GEN007,\n \n sum(case when ccsr_category = 'GEN008' then dx_code else 0 end) as dxccsr_GEN008,\n \n sum(case when ccsr_category = 'GEN009' then dx_code else 0 end) as dxccsr_GEN009,\n \n sum(case when ccsr_category = 'GEN010' then dx_code else 0 end) as dxccsr_GEN010,\n \n sum(case when ccsr_category = 'GEN011' then dx_code else 0 end) as dxccsr_GEN011,\n \n sum(case when ccsr_category = 'GEN012' then dx_code else 0 end) as dxccsr_GEN012,\n \n sum(case when ccsr_category = 'GEN013' then dx_code else 0 end) as dxccsr_GEN013,\n \n sum(case when ccsr_category = 'GEN014' then dx_code else 0 end) as dxccsr_GEN014,\n \n sum(case when ccsr_category = 'GEN015' then dx_code else 0 end) as dxccsr_GEN015,\n \n sum(case when ccsr_category = 'GEN016' then dx_code else 0 end) as dxccsr_GEN016,\n \n sum(case when ccsr_category = 'GEN017' then dx_code else 0 end) as dxccsr_GEN017,\n \n sum(case when ccsr_category = 'GEN018' then dx_code else 0 end) as dxccsr_GEN018,\n \n sum(case when ccsr_category = 'GEN019' then dx_code else 0 end) as dxccsr_GEN019,\n \n sum(case when ccsr_category = 'GEN020' then dx_code else 0 end) as dxccsr_GEN020,\n \n sum(case when ccsr_category = 'GEN021' then dx_code else 0 end) as dxccsr_GEN021,\n \n sum(case when ccsr_category = 'GEN022' then dx_code else 0 end) as dxccsr_GEN022,\n \n sum(case when ccsr_category = 'GEN023' then dx_code else 0 end) as dxccsr_GEN023,\n \n sum(case when ccsr_category = 'GEN024' then dx_code else 0 end) as dxccsr_GEN024,\n \n sum(case when ccsr_category = 'GEN025' then dx_code else 0 end) as dxccsr_GEN025,\n \n sum(case when ccsr_category = 'GEN026' then dx_code else 0 end) as dxccsr_GEN026,\n \n sum(case when ccsr_category = 'INF001' then dx_code else 0 end) as dxccsr_INF001,\n \n sum(case when ccsr_category = 'INF002' then dx_code else 0 end) as dxccsr_INF002,\n \n sum(case when ccsr_category = 'INF003' then dx_code else 0 end) as dxccsr_INF003,\n \n sum(case when ccsr_category = 'INF004' then dx_code else 0 end) as dxccsr_INF004,\n \n sum(case when ccsr_category = 'INF005' then dx_code else 0 end) as dxccsr_INF005,\n \n sum(case when ccsr_category = 'INF006' then dx_code else 0 end) as dxccsr_INF006,\n \n sum(case when ccsr_category = 'INF007' then dx_code else 0 end) as dxccsr_INF007,\n \n sum(case when ccsr_category = 'INF008' then dx_code else 0 end) as dxccsr_INF008,\n \n sum(case when ccsr_category = 'INF009' then dx_code else 0 end) as dxccsr_INF009,\n \n sum(case when ccsr_category = 'INF010' then dx_code else 0 end) as dxccsr_INF010,\n \n sum(case when ccsr_category = 'INF011' then dx_code else 0 end) as dxccsr_INF011,\n \n sum(case when ccsr_category = 'INF012' then dx_code else 0 end) as dxccsr_INF012,\n \n sum(case when ccsr_category = 'INJ001' then dx_code else 0 end) as dxccsr_INJ001,\n \n sum(case when ccsr_category = 'INJ002' then dx_code else 0 end) as dxccsr_INJ002,\n \n sum(case when ccsr_category = 'INJ003' then dx_code else 0 end) as dxccsr_INJ003,\n \n sum(case when ccsr_category = 'INJ004' then dx_code else 0 end) as dxccsr_INJ004,\n \n sum(case when ccsr_category = 'INJ005' then dx_code else 0 end) as dxccsr_INJ005,\n \n sum(case when ccsr_category = 'INJ006' then dx_code else 0 end) as dxccsr_INJ006,\n \n sum(case when ccsr_category = 'INJ007' then dx_code else 0 end) as dxccsr_INJ007,\n \n sum(case when ccsr_category = 'INJ008' then dx_code else 0 end) as dxccsr_INJ008,\n \n sum(case when ccsr_category = 'INJ009' then dx_code else 0 end) as dxccsr_INJ009,\n \n sum(case when ccsr_category = 'INJ010' then dx_code else 0 end) as dxccsr_INJ010,\n \n sum(case when ccsr_category = 'INJ011' then dx_code else 0 end) as dxccsr_INJ011,\n \n sum(case when ccsr_category = 'INJ012' then dx_code else 0 end) as dxccsr_INJ012,\n \n sum(case when ccsr_category = 'INJ013' then dx_code else 0 end) as dxccsr_INJ013,\n \n sum(case when ccsr_category = 'INJ014' then dx_code else 0 end) as dxccsr_INJ014,\n \n sum(case when ccsr_category = 'INJ015' then dx_code else 0 end) as dxccsr_INJ015,\n \n sum(case when ccsr_category = 'INJ016' then dx_code else 0 end) as dxccsr_INJ016,\n \n sum(case when ccsr_category = 'INJ017' then dx_code else 0 end) as dxccsr_INJ017,\n \n sum(case when ccsr_category = 'INJ018' then dx_code else 0 end) as dxccsr_INJ018,\n \n sum(case when ccsr_category = 'INJ019' then dx_code else 0 end) as dxccsr_INJ019,\n \n sum(case when ccsr_category = 'INJ020' then dx_code else 0 end) as dxccsr_INJ020,\n \n sum(case when ccsr_category = 'INJ021' then dx_code else 0 end) as dxccsr_INJ021,\n \n sum(case when ccsr_category = 'INJ022' then dx_code else 0 end) as dxccsr_INJ022,\n \n sum(case when ccsr_category = 'INJ023' then dx_code else 0 end) as dxccsr_INJ023,\n \n sum(case when ccsr_category = 'INJ024' then dx_code else 0 end) as dxccsr_INJ024,\n \n sum(case when ccsr_category = 'INJ025' then dx_code else 0 end) as dxccsr_INJ025,\n \n sum(case when ccsr_category = 'INJ026' then dx_code else 0 end) as dxccsr_INJ026,\n \n sum(case when ccsr_category = 'INJ027' then dx_code else 0 end) as dxccsr_INJ027,\n \n sum(case when ccsr_category = 'INJ028' then dx_code else 0 end) as dxccsr_INJ028,\n \n sum(case when ccsr_category = 'INJ029' then dx_code else 0 end) as dxccsr_INJ029,\n \n sum(case when ccsr_category = 'INJ030' then dx_code else 0 end) as dxccsr_INJ030,\n \n sum(case when ccsr_category = 'INJ031' then dx_code else 0 end) as dxccsr_INJ031,\n \n sum(case when ccsr_category = 'INJ032' then dx_code else 0 end) as dxccsr_INJ032,\n \n sum(case when ccsr_category = 'INJ033' then dx_code else 0 end) as dxccsr_INJ033,\n \n sum(case when ccsr_category = 'INJ034' then dx_code else 0 end) as dxccsr_INJ034,\n \n sum(case when ccsr_category = 'INJ035' then dx_code else 0 end) as dxccsr_INJ035,\n \n sum(case when ccsr_category = 'INJ036' then dx_code else 0 end) as dxccsr_INJ036,\n \n sum(case when ccsr_category = 'INJ037' then dx_code else 0 end) as dxccsr_INJ037,\n \n sum(case when ccsr_category = 'INJ038' then dx_code else 0 end) as dxccsr_INJ038,\n \n sum(case when ccsr_category = 'INJ039' then dx_code else 0 end) as dxccsr_INJ039,\n \n sum(case when ccsr_category = 'INJ040' then dx_code else 0 end) as dxccsr_INJ040,\n \n sum(case when ccsr_category = 'INJ041' then dx_code else 0 end) as dxccsr_INJ041,\n \n sum(case when ccsr_category = 'INJ042' then dx_code else 0 end) as dxccsr_INJ042,\n \n sum(case when ccsr_category = 'INJ043' then dx_code else 0 end) as dxccsr_INJ043,\n \n sum(case when ccsr_category = 'INJ044' then dx_code else 0 end) as dxccsr_INJ044,\n \n sum(case when ccsr_category = 'INJ045' then dx_code else 0 end) as dxccsr_INJ045,\n \n sum(case when ccsr_category = 'INJ046' then dx_code else 0 end) as dxccsr_INJ046,\n \n sum(case when ccsr_category = 'INJ047' then dx_code else 0 end) as dxccsr_INJ047,\n \n sum(case when ccsr_category = 'INJ048' then dx_code else 0 end) as dxccsr_INJ048,\n \n sum(case when ccsr_category = 'INJ049' then dx_code else 0 end) as dxccsr_INJ049,\n \n sum(case when ccsr_category = 'INJ050' then dx_code else 0 end) as dxccsr_INJ050,\n \n sum(case when ccsr_category = 'INJ051' then dx_code else 0 end) as dxccsr_INJ051,\n \n sum(case when ccsr_category = 'INJ052' then dx_code else 0 end) as dxccsr_INJ052,\n \n sum(case when ccsr_category = 'INJ053' then dx_code else 0 end) as dxccsr_INJ053,\n \n sum(case when ccsr_category = 'INJ054' then dx_code else 0 end) as dxccsr_INJ054,\n \n sum(case when ccsr_category = 'INJ055' then dx_code else 0 end) as dxccsr_INJ055,\n \n sum(case when ccsr_category = 'INJ056' then dx_code else 0 end) as dxccsr_INJ056,\n \n sum(case when ccsr_category = 'INJ057' then dx_code else 0 end) as dxccsr_INJ057,\n \n sum(case when ccsr_category = 'INJ058' then dx_code else 0 end) as dxccsr_INJ058,\n \n sum(case when ccsr_category = 'INJ059' then dx_code else 0 end) as dxccsr_INJ059,\n \n sum(case when ccsr_category = 'INJ060' then dx_code else 0 end) as dxccsr_INJ060,\n \n sum(case when ccsr_category = 'INJ061' then dx_code else 0 end) as dxccsr_INJ061,\n \n sum(case when ccsr_category = 'INJ062' then dx_code else 0 end) as dxccsr_INJ062,\n \n sum(case when ccsr_category = 'INJ063' then dx_code else 0 end) as dxccsr_INJ063,\n \n sum(case when ccsr_category = 'INJ064' then dx_code else 0 end) as dxccsr_INJ064,\n \n sum(case when ccsr_category = 'INJ065' then dx_code else 0 end) as dxccsr_INJ065,\n \n sum(case when ccsr_category = 'INJ066' then dx_code else 0 end) as dxccsr_INJ066,\n \n sum(case when ccsr_category = 'INJ067' then dx_code else 0 end) as dxccsr_INJ067,\n \n sum(case when ccsr_category = 'INJ068' then dx_code else 0 end) as dxccsr_INJ068,\n \n sum(case when ccsr_category = 'INJ069' then dx_code else 0 end) as dxccsr_INJ069,\n \n sum(case when ccsr_category = 'INJ070' then dx_code else 0 end) as dxccsr_INJ070,\n \n sum(case when ccsr_category = 'INJ071' then dx_code else 0 end) as dxccsr_INJ071,\n \n sum(case when ccsr_category = 'INJ072' then dx_code else 0 end) as dxccsr_INJ072,\n \n sum(case when ccsr_category = 'INJ073' then dx_code else 0 end) as dxccsr_INJ073,\n \n sum(case when ccsr_category = 'INJ074' then dx_code else 0 end) as dxccsr_INJ074,\n \n sum(case when ccsr_category = 'INJ075' then dx_code else 0 end) as dxccsr_INJ075,\n \n sum(case when ccsr_category = 'INJ076' then dx_code else 0 end) as dxccsr_INJ076,\n \n sum(case when ccsr_category = 'MAL001' then dx_code else 0 end) as dxccsr_MAL001,\n \n sum(case when ccsr_category = 'MAL002' then dx_code else 0 end) as dxccsr_MAL002,\n \n sum(case when ccsr_category = 'MAL003' then dx_code else 0 end) as dxccsr_MAL003,\n \n sum(case when ccsr_category = 'MAL004' then dx_code else 0 end) as dxccsr_MAL004,\n \n sum(case when ccsr_category = 'MAL005' then dx_code else 0 end) as dxccsr_MAL005,\n \n sum(case when ccsr_category = 'MAL006' then dx_code else 0 end) as dxccsr_MAL006,\n \n sum(case when ccsr_category = 'MAL007' then dx_code else 0 end) as dxccsr_MAL007,\n \n sum(case when ccsr_category = 'MAL008' then dx_code else 0 end) as dxccsr_MAL008,\n \n sum(case when ccsr_category = 'MAL009' then dx_code else 0 end) as dxccsr_MAL009,\n \n sum(case when ccsr_category = 'MAL010' then dx_code else 0 end) as dxccsr_MAL010,\n \n sum(case when ccsr_category = 'MBD001' then dx_code else 0 end) as dxccsr_MBD001,\n \n sum(case when ccsr_category = 'MBD002' then dx_code else 0 end) as dxccsr_MBD002,\n \n sum(case when ccsr_category = 'MBD003' then dx_code else 0 end) as dxccsr_MBD003,\n \n sum(case when ccsr_category = 'MBD004' then dx_code else 0 end) as dxccsr_MBD004,\n \n sum(case when ccsr_category = 'MBD005' then dx_code else 0 end) as dxccsr_MBD005,\n \n sum(case when ccsr_category = 'MBD006' then dx_code else 0 end) as dxccsr_MBD006,\n \n sum(case when ccsr_category = 'MBD007' then dx_code else 0 end) as dxccsr_MBD007,\n \n sum(case when ccsr_category = 'MBD008' then dx_code else 0 end) as dxccsr_MBD008,\n \n sum(case when ccsr_category = 'MBD009' then dx_code else 0 end) as dxccsr_MBD009,\n \n sum(case when ccsr_category = 'MBD010' then dx_code else 0 end) as dxccsr_MBD010,\n \n sum(case when ccsr_category = 'MBD011' then dx_code else 0 end) as dxccsr_MBD011,\n \n sum(case when ccsr_category = 'MBD012' then dx_code else 0 end) as dxccsr_MBD012,\n \n sum(case when ccsr_category = 'MBD013' then dx_code else 0 end) as dxccsr_MBD013,\n \n sum(case when ccsr_category = 'MBD014' then dx_code else 0 end) as dxccsr_MBD014,\n \n sum(case when ccsr_category = 'MBD017' then dx_code else 0 end) as dxccsr_MBD017,\n \n sum(case when ccsr_category = 'MBD018' then dx_code else 0 end) as dxccsr_MBD018,\n \n sum(case when ccsr_category = 'MBD019' then dx_code else 0 end) as dxccsr_MBD019,\n \n sum(case when ccsr_category = 'MBD020' then dx_code else 0 end) as dxccsr_MBD020,\n \n sum(case when ccsr_category = 'MBD021' then dx_code else 0 end) as dxccsr_MBD021,\n \n sum(case when ccsr_category = 'MBD022' then dx_code else 0 end) as dxccsr_MBD022,\n \n sum(case when ccsr_category = 'MBD023' then dx_code else 0 end) as dxccsr_MBD023,\n \n sum(case when ccsr_category = 'MBD024' then dx_code else 0 end) as dxccsr_MBD024,\n \n sum(case when ccsr_category = 'MBD025' then dx_code else 0 end) as dxccsr_MBD025,\n \n sum(case when ccsr_category = 'MBD026' then dx_code else 0 end) as dxccsr_MBD026,\n \n sum(case when ccsr_category = 'MBD027' then dx_code else 0 end) as dxccsr_MBD027,\n \n sum(case when ccsr_category = 'MBD028' then dx_code else 0 end) as dxccsr_MBD028,\n \n sum(case when ccsr_category = 'MBD029' then dx_code else 0 end) as dxccsr_MBD029,\n \n sum(case when ccsr_category = 'MBD030' then dx_code else 0 end) as dxccsr_MBD030,\n \n sum(case when ccsr_category = 'MBD031' then dx_code else 0 end) as dxccsr_MBD031,\n \n sum(case when ccsr_category = 'MBD032' then dx_code else 0 end) as dxccsr_MBD032,\n \n sum(case when ccsr_category = 'MBD033' then dx_code else 0 end) as dxccsr_MBD033,\n \n sum(case when ccsr_category = 'MBD034' then dx_code else 0 end) as dxccsr_MBD034,\n \n sum(case when ccsr_category = 'MUS001' then dx_code else 0 end) as dxccsr_MUS001,\n \n sum(case when ccsr_category = 'MUS002' then dx_code else 0 end) as dxccsr_MUS002,\n \n sum(case when ccsr_category = 'MUS003' then dx_code else 0 end) as dxccsr_MUS003,\n \n sum(case when ccsr_category = 'MUS004' then dx_code else 0 end) as dxccsr_MUS004,\n \n sum(case when ccsr_category = 'MUS005' then dx_code else 0 end) as dxccsr_MUS005,\n \n sum(case when ccsr_category = 'MUS006' then dx_code else 0 end) as dxccsr_MUS006,\n \n sum(case when ccsr_category = 'MUS007' then dx_code else 0 end) as dxccsr_MUS007,\n \n sum(case when ccsr_category = 'MUS008' then dx_code else 0 end) as dxccsr_MUS008,\n \n sum(case when ccsr_category = 'MUS009' then dx_code else 0 end) as dxccsr_MUS009,\n \n sum(case when ccsr_category = 'MUS010' then dx_code else 0 end) as dxccsr_MUS010,\n \n sum(case when ccsr_category = 'MUS011' then dx_code else 0 end) as dxccsr_MUS011,\n \n sum(case when ccsr_category = 'MUS012' then dx_code else 0 end) as dxccsr_MUS012,\n \n sum(case when ccsr_category = 'MUS013' then dx_code else 0 end) as dxccsr_MUS013,\n \n sum(case when ccsr_category = 'MUS014' then dx_code else 0 end) as dxccsr_MUS014,\n \n sum(case when ccsr_category = 'MUS015' then dx_code else 0 end) as dxccsr_MUS015,\n \n sum(case when ccsr_category = 'MUS016' then dx_code else 0 end) as dxccsr_MUS016,\n \n sum(case when ccsr_category = 'MUS017' then dx_code else 0 end) as dxccsr_MUS017,\n \n sum(case when ccsr_category = 'MUS018' then dx_code else 0 end) as dxccsr_MUS018,\n \n sum(case when ccsr_category = 'MUS019' then dx_code else 0 end) as dxccsr_MUS019,\n \n sum(case when ccsr_category = 'MUS020' then dx_code else 0 end) as dxccsr_MUS020,\n \n sum(case when ccsr_category = 'MUS021' then dx_code else 0 end) as dxccsr_MUS021,\n \n sum(case when ccsr_category = 'MUS022' then dx_code else 0 end) as dxccsr_MUS022,\n \n sum(case when ccsr_category = 'MUS023' then dx_code else 0 end) as dxccsr_MUS023,\n \n sum(case when ccsr_category = 'MUS024' then dx_code else 0 end) as dxccsr_MUS024,\n \n sum(case when ccsr_category = 'MUS025' then dx_code else 0 end) as dxccsr_MUS025,\n \n sum(case when ccsr_category = 'MUS026' then dx_code else 0 end) as dxccsr_MUS026,\n \n sum(case when ccsr_category = 'MUS027' then dx_code else 0 end) as dxccsr_MUS027,\n \n sum(case when ccsr_category = 'MUS028' then dx_code else 0 end) as dxccsr_MUS028,\n \n sum(case when ccsr_category = 'MUS029' then dx_code else 0 end) as dxccsr_MUS029,\n \n sum(case when ccsr_category = 'MUS030' then dx_code else 0 end) as dxccsr_MUS030,\n \n sum(case when ccsr_category = 'MUS031' then dx_code else 0 end) as dxccsr_MUS031,\n \n sum(case when ccsr_category = 'MUS032' then dx_code else 0 end) as dxccsr_MUS032,\n \n sum(case when ccsr_category = 'MUS033' then dx_code else 0 end) as dxccsr_MUS033,\n \n sum(case when ccsr_category = 'MUS034' then dx_code else 0 end) as dxccsr_MUS034,\n \n sum(case when ccsr_category = 'MUS035' then dx_code else 0 end) as dxccsr_MUS035,\n \n sum(case when ccsr_category = 'MUS036' then dx_code else 0 end) as dxccsr_MUS036,\n \n sum(case when ccsr_category = 'MUS037' then dx_code else 0 end) as dxccsr_MUS037,\n \n sum(case when ccsr_category = 'MUS038' then dx_code else 0 end) as dxccsr_MUS038,\n \n sum(case when ccsr_category = 'NEO001' then dx_code else 0 end) as dxccsr_NEO001,\n \n sum(case when ccsr_category = 'NEO002' then dx_code else 0 end) as dxccsr_NEO002,\n \n sum(case when ccsr_category = 'NEO003' then dx_code else 0 end) as dxccsr_NEO003,\n \n sum(case when ccsr_category = 'NEO004' then dx_code else 0 end) as dxccsr_NEO004,\n \n sum(case when ccsr_category = 'NEO005' then dx_code else 0 end) as dxccsr_NEO005,\n \n sum(case when ccsr_category = 'NEO006' then dx_code else 0 end) as dxccsr_NEO006,\n \n sum(case when ccsr_category = 'NEO007' then dx_code else 0 end) as dxccsr_NEO007,\n \n sum(case when ccsr_category = 'NEO008' then dx_code else 0 end) as dxccsr_NEO008,\n \n sum(case when ccsr_category = 'NEO009' then dx_code else 0 end) as dxccsr_NEO009,\n \n sum(case when ccsr_category = 'NEO010' then dx_code else 0 end) as dxccsr_NEO010,\n \n sum(case when ccsr_category = 'NEO011' then dx_code else 0 end) as dxccsr_NEO011,\n \n sum(case when ccsr_category = 'NEO012' then dx_code else 0 end) as dxccsr_NEO012,\n \n sum(case when ccsr_category = 'NEO013' then dx_code else 0 end) as dxccsr_NEO013,\n \n sum(case when ccsr_category = 'NEO014' then dx_code else 0 end) as dxccsr_NEO014,\n \n sum(case when ccsr_category = 'NEO015' then dx_code else 0 end) as dxccsr_NEO015,\n \n sum(case when ccsr_category = 'NEO016' then dx_code else 0 end) as dxccsr_NEO016,\n \n sum(case when ccsr_category = 'NEO017' then dx_code else 0 end) as dxccsr_NEO017,\n \n sum(case when ccsr_category = 'NEO018' then dx_code else 0 end) as dxccsr_NEO018,\n \n sum(case when ccsr_category = 'NEO019' then dx_code else 0 end) as dxccsr_NEO019,\n \n sum(case when ccsr_category = 'NEO020' then dx_code else 0 end) as dxccsr_NEO020,\n \n sum(case when ccsr_category = 'NEO021' then dx_code else 0 end) as dxccsr_NEO021,\n \n sum(case when ccsr_category = 'NEO022' then dx_code else 0 end) as dxccsr_NEO022,\n \n sum(case when ccsr_category = 'NEO023' then dx_code else 0 end) as dxccsr_NEO023,\n \n sum(case when ccsr_category = 'NEO024' then dx_code else 0 end) as dxccsr_NEO024,\n \n sum(case when ccsr_category = 'NEO025' then dx_code else 0 end) as dxccsr_NEO025,\n \n sum(case when ccsr_category = 'NEO026' then dx_code else 0 end) as dxccsr_NEO026,\n \n sum(case when ccsr_category = 'NEO027' then dx_code else 0 end) as dxccsr_NEO027,\n \n sum(case when ccsr_category = 'NEO028' then dx_code else 0 end) as dxccsr_NEO028,\n \n sum(case when ccsr_category = 'NEO029' then dx_code else 0 end) as dxccsr_NEO029,\n \n sum(case when ccsr_category = 'NEO030' then dx_code else 0 end) as dxccsr_NEO030,\n \n sum(case when ccsr_category = 'NEO031' then dx_code else 0 end) as dxccsr_NEO031,\n \n sum(case when ccsr_category = 'NEO032' then dx_code else 0 end) as dxccsr_NEO032,\n \n sum(case when ccsr_category = 'NEO033' then dx_code else 0 end) as dxccsr_NEO033,\n \n sum(case when ccsr_category = 'NEO034' then dx_code else 0 end) as dxccsr_NEO034,\n \n sum(case when ccsr_category = 'NEO035' then dx_code else 0 end) as dxccsr_NEO035,\n \n sum(case when ccsr_category = 'NEO036' then dx_code else 0 end) as dxccsr_NEO036,\n \n sum(case when ccsr_category = 'NEO037' then dx_code else 0 end) as dxccsr_NEO037,\n \n sum(case when ccsr_category = 'NEO038' then dx_code else 0 end) as dxccsr_NEO038,\n \n sum(case when ccsr_category = 'NEO039' then dx_code else 0 end) as dxccsr_NEO039,\n \n sum(case when ccsr_category = 'NEO040' then dx_code else 0 end) as dxccsr_NEO040,\n \n sum(case when ccsr_category = 'NEO041' then dx_code else 0 end) as dxccsr_NEO041,\n \n sum(case when ccsr_category = 'NEO042' then dx_code else 0 end) as dxccsr_NEO042,\n \n sum(case when ccsr_category = 'NEO043' then dx_code else 0 end) as dxccsr_NEO043,\n \n sum(case when ccsr_category = 'NEO044' then dx_code else 0 end) as dxccsr_NEO044,\n \n sum(case when ccsr_category = 'NEO045' then dx_code else 0 end) as dxccsr_NEO045,\n \n sum(case when ccsr_category = 'NEO046' then dx_code else 0 end) as dxccsr_NEO046,\n \n sum(case when ccsr_category = 'NEO047' then dx_code else 0 end) as dxccsr_NEO047,\n \n sum(case when ccsr_category = 'NEO048' then dx_code else 0 end) as dxccsr_NEO048,\n \n sum(case when ccsr_category = 'NEO049' then dx_code else 0 end) as dxccsr_NEO049,\n \n sum(case when ccsr_category = 'NEO050' then dx_code else 0 end) as dxccsr_NEO050,\n \n sum(case when ccsr_category = 'NEO051' then dx_code else 0 end) as dxccsr_NEO051,\n \n sum(case when ccsr_category = 'NEO052' then dx_code else 0 end) as dxccsr_NEO052,\n \n sum(case when ccsr_category = 'NEO053' then dx_code else 0 end) as dxccsr_NEO053,\n \n sum(case when ccsr_category = 'NEO054' then dx_code else 0 end) as dxccsr_NEO054,\n \n sum(case when ccsr_category = 'NEO055' then dx_code else 0 end) as dxccsr_NEO055,\n \n sum(case when ccsr_category = 'NEO056' then dx_code else 0 end) as dxccsr_NEO056,\n \n sum(case when ccsr_category = 'NEO057' then dx_code else 0 end) as dxccsr_NEO057,\n \n sum(case when ccsr_category = 'NEO058' then dx_code else 0 end) as dxccsr_NEO058,\n \n sum(case when ccsr_category = 'NEO059' then dx_code else 0 end) as dxccsr_NEO059,\n \n sum(case when ccsr_category = 'NEO060' then dx_code else 0 end) as dxccsr_NEO060,\n \n sum(case when ccsr_category = 'NEO061' then dx_code else 0 end) as dxccsr_NEO061,\n \n sum(case when ccsr_category = 'NEO062' then dx_code else 0 end) as dxccsr_NEO062,\n \n sum(case when ccsr_category = 'NEO063' then dx_code else 0 end) as dxccsr_NEO063,\n \n sum(case when ccsr_category = 'NEO064' then dx_code else 0 end) as dxccsr_NEO064,\n \n sum(case when ccsr_category = 'NEO065' then dx_code else 0 end) as dxccsr_NEO065,\n \n sum(case when ccsr_category = 'NEO066' then dx_code else 0 end) as dxccsr_NEO066,\n \n sum(case when ccsr_category = 'NEO067' then dx_code else 0 end) as dxccsr_NEO067,\n \n sum(case when ccsr_category = 'NEO068' then dx_code else 0 end) as dxccsr_NEO068,\n \n sum(case when ccsr_category = 'NEO069' then dx_code else 0 end) as dxccsr_NEO069,\n \n sum(case when ccsr_category = 'NEO070' then dx_code else 0 end) as dxccsr_NEO070,\n \n sum(case when ccsr_category = 'NEO071' then dx_code else 0 end) as dxccsr_NEO071,\n \n sum(case when ccsr_category = 'NEO072' then dx_code else 0 end) as dxccsr_NEO072,\n \n sum(case when ccsr_category = 'NEO073' then dx_code else 0 end) as dxccsr_NEO073,\n \n sum(case when ccsr_category = 'NEO074' then dx_code else 0 end) as dxccsr_NEO074,\n \n sum(case when ccsr_category = 'NVS001' then dx_code else 0 end) as dxccsr_NVS001,\n \n sum(case when ccsr_category = 'NVS002' then dx_code else 0 end) as dxccsr_NVS002,\n \n sum(case when ccsr_category = 'NVS003' then dx_code else 0 end) as dxccsr_NVS003,\n \n sum(case when ccsr_category = 'NVS004' then dx_code else 0 end) as dxccsr_NVS004,\n \n sum(case when ccsr_category = 'NVS005' then dx_code else 0 end) as dxccsr_NVS005,\n \n sum(case when ccsr_category = 'NVS006' then dx_code else 0 end) as dxccsr_NVS006,\n \n sum(case when ccsr_category = 'NVS007' then dx_code else 0 end) as dxccsr_NVS007,\n \n sum(case when ccsr_category = 'NVS008' then dx_code else 0 end) as dxccsr_NVS008,\n \n sum(case when ccsr_category = 'NVS009' then dx_code else 0 end) as dxccsr_NVS009,\n \n sum(case when ccsr_category = 'NVS010' then dx_code else 0 end) as dxccsr_NVS010,\n \n sum(case when ccsr_category = 'NVS011' then dx_code else 0 end) as dxccsr_NVS011,\n \n sum(case when ccsr_category = 'NVS012' then dx_code else 0 end) as dxccsr_NVS012,\n \n sum(case when ccsr_category = 'NVS013' then dx_code else 0 end) as dxccsr_NVS013,\n \n sum(case when ccsr_category = 'NVS014' then dx_code else 0 end) as dxccsr_NVS014,\n \n sum(case when ccsr_category = 'NVS015' then dx_code else 0 end) as dxccsr_NVS015,\n \n sum(case when ccsr_category = 'NVS016' then dx_code else 0 end) as dxccsr_NVS016,\n \n sum(case when ccsr_category = 'NVS017' then dx_code else 0 end) as dxccsr_NVS017,\n \n sum(case when ccsr_category = 'NVS018' then dx_code else 0 end) as dxccsr_NVS018,\n \n sum(case when ccsr_category = 'NVS019' then dx_code else 0 end) as dxccsr_NVS019,\n \n sum(case when ccsr_category = 'NVS020' then dx_code else 0 end) as dxccsr_NVS020,\n \n sum(case when ccsr_category = 'NVS021' then dx_code else 0 end) as dxccsr_NVS021,\n \n sum(case when ccsr_category = 'NVS022' then dx_code else 0 end) as dxccsr_NVS022,\n \n sum(case when ccsr_category = 'PNL001' then dx_code else 0 end) as dxccsr_PNL001,\n \n sum(case when ccsr_category = 'PNL002' then dx_code else 0 end) as dxccsr_PNL002,\n \n sum(case when ccsr_category = 'PNL003' then dx_code else 0 end) as dxccsr_PNL003,\n \n sum(case when ccsr_category = 'PNL004' then dx_code else 0 end) as dxccsr_PNL004,\n \n sum(case when ccsr_category = 'PNL005' then dx_code else 0 end) as dxccsr_PNL005,\n \n sum(case when ccsr_category = 'PNL006' then dx_code else 0 end) as dxccsr_PNL006,\n \n sum(case when ccsr_category = 'PNL007' then dx_code else 0 end) as dxccsr_PNL007,\n \n sum(case when ccsr_category = 'PNL008' then dx_code else 0 end) as dxccsr_PNL008,\n \n sum(case when ccsr_category = 'PNL009' then dx_code else 0 end) as dxccsr_PNL009,\n \n sum(case when ccsr_category = 'PNL010' then dx_code else 0 end) as dxccsr_PNL010,\n \n sum(case when ccsr_category = 'PNL011' then dx_code else 0 end) as dxccsr_PNL011,\n \n sum(case when ccsr_category = 'PNL012' then dx_code else 0 end) as dxccsr_PNL012,\n \n sum(case when ccsr_category = 'PNL013' then dx_code else 0 end) as dxccsr_PNL013,\n \n sum(case when ccsr_category = 'PNL014' then dx_code else 0 end) as dxccsr_PNL014,\n \n sum(case when ccsr_category = 'PNL015' then dx_code else 0 end) as dxccsr_PNL015,\n \n sum(case when ccsr_category = 'PRG001' then dx_code else 0 end) as dxccsr_PRG001,\n \n sum(case when ccsr_category = 'PRG002' then dx_code else 0 end) as dxccsr_PRG002,\n \n sum(case when ccsr_category = 'PRG003' then dx_code else 0 end) as dxccsr_PRG003,\n \n sum(case when ccsr_category = 'PRG004' then dx_code else 0 end) as dxccsr_PRG004,\n \n sum(case when ccsr_category = 'PRG005' then dx_code else 0 end) as dxccsr_PRG005,\n \n sum(case when ccsr_category = 'PRG006' then dx_code else 0 end) as dxccsr_PRG006,\n \n sum(case when ccsr_category = 'PRG007' then dx_code else 0 end) as dxccsr_PRG007,\n \n sum(case when ccsr_category = 'PRG008' then dx_code else 0 end) as dxccsr_PRG008,\n \n sum(case when ccsr_category = 'PRG009' then dx_code else 0 end) as dxccsr_PRG009,\n \n sum(case when ccsr_category = 'PRG010' then dx_code else 0 end) as dxccsr_PRG010,\n \n sum(case when ccsr_category = 'PRG011' then dx_code else 0 end) as dxccsr_PRG011,\n \n sum(case when ccsr_category = 'PRG012' then dx_code else 0 end) as dxccsr_PRG012,\n \n sum(case when ccsr_category = 'PRG013' then dx_code else 0 end) as dxccsr_PRG013,\n \n sum(case when ccsr_category = 'PRG014' then dx_code else 0 end) as dxccsr_PRG014,\n \n sum(case when ccsr_category = 'PRG015' then dx_code else 0 end) as dxccsr_PRG015,\n \n sum(case when ccsr_category = 'PRG016' then dx_code else 0 end) as dxccsr_PRG016,\n \n sum(case when ccsr_category = 'PRG017' then dx_code else 0 end) as dxccsr_PRG017,\n \n sum(case when ccsr_category = 'PRG018' then dx_code else 0 end) as dxccsr_PRG018,\n \n sum(case when ccsr_category = 'PRG019' then dx_code else 0 end) as dxccsr_PRG019,\n \n sum(case when ccsr_category = 'PRG020' then dx_code else 0 end) as dxccsr_PRG020,\n \n sum(case when ccsr_category = 'PRG021' then dx_code else 0 end) as dxccsr_PRG021,\n \n sum(case when ccsr_category = 'PRG022' then dx_code else 0 end) as dxccsr_PRG022,\n \n sum(case when ccsr_category = 'PRG023' then dx_code else 0 end) as dxccsr_PRG023,\n \n sum(case when ccsr_category = 'PRG024' then dx_code else 0 end) as dxccsr_PRG024,\n \n sum(case when ccsr_category = 'PRG025' then dx_code else 0 end) as dxccsr_PRG025,\n \n sum(case when ccsr_category = 'PRG026' then dx_code else 0 end) as dxccsr_PRG026,\n \n sum(case when ccsr_category = 'PRG027' then dx_code else 0 end) as dxccsr_PRG027,\n \n sum(case when ccsr_category = 'PRG028' then dx_code else 0 end) as dxccsr_PRG028,\n \n sum(case when ccsr_category = 'PRG029' then dx_code else 0 end) as dxccsr_PRG029,\n \n sum(case when ccsr_category = 'PRG030' then dx_code else 0 end) as dxccsr_PRG030,\n \n sum(case when ccsr_category = 'RSP001' then dx_code else 0 end) as dxccsr_RSP001,\n \n sum(case when ccsr_category = 'RSP002' then dx_code else 0 end) as dxccsr_RSP002,\n \n sum(case when ccsr_category = 'RSP003' then dx_code else 0 end) as dxccsr_RSP003,\n \n sum(case when ccsr_category = 'RSP004' then dx_code else 0 end) as dxccsr_RSP004,\n \n sum(case when ccsr_category = 'RSP005' then dx_code else 0 end) as dxccsr_RSP005,\n \n sum(case when ccsr_category = 'RSP006' then dx_code else 0 end) as dxccsr_RSP006,\n \n sum(case when ccsr_category = 'RSP007' then dx_code else 0 end) as dxccsr_RSP007,\n \n sum(case when ccsr_category = 'RSP008' then dx_code else 0 end) as dxccsr_RSP008,\n \n sum(case when ccsr_category = 'RSP009' then dx_code else 0 end) as dxccsr_RSP009,\n \n sum(case when ccsr_category = 'RSP010' then dx_code else 0 end) as dxccsr_RSP010,\n \n sum(case when ccsr_category = 'RSP011' then dx_code else 0 end) as dxccsr_RSP011,\n \n sum(case when ccsr_category = 'RSP012' then dx_code else 0 end) as dxccsr_RSP012,\n \n sum(case when ccsr_category = 'RSP013' then dx_code else 0 end) as dxccsr_RSP013,\n \n sum(case when ccsr_category = 'RSP014' then dx_code else 0 end) as dxccsr_RSP014,\n \n sum(case when ccsr_category = 'RSP015' then dx_code else 0 end) as dxccsr_RSP015,\n \n sum(case when ccsr_category = 'RSP016' then dx_code else 0 end) as dxccsr_RSP016,\n \n sum(case when ccsr_category = 'RSP017' then dx_code else 0 end) as dxccsr_RSP017,\n \n sum(case when ccsr_category = 'SKN001' then dx_code else 0 end) as dxccsr_SKN001,\n \n sum(case when ccsr_category = 'SKN002' then dx_code else 0 end) as dxccsr_SKN002,\n \n sum(case when ccsr_category = 'SKN003' then dx_code else 0 end) as dxccsr_SKN003,\n \n sum(case when ccsr_category = 'SKN004' then dx_code else 0 end) as dxccsr_SKN004,\n \n sum(case when ccsr_category = 'SKN005' then dx_code else 0 end) as dxccsr_SKN005,\n \n sum(case when ccsr_category = 'SKN006' then dx_code else 0 end) as dxccsr_SKN006,\n \n sum(case when ccsr_category = 'SKN007' then dx_code else 0 end) as dxccsr_SKN007,\n \n sum(case when ccsr_category = 'SYM001' then dx_code else 0 end) as dxccsr_SYM001,\n \n sum(case when ccsr_category = 'SYM002' then dx_code else 0 end) as dxccsr_SYM002,\n \n sum(case when ccsr_category = 'SYM003' then dx_code else 0 end) as dxccsr_SYM003,\n \n sum(case when ccsr_category = 'SYM004' then dx_code else 0 end) as dxccsr_SYM004,\n \n sum(case when ccsr_category = 'SYM005' then dx_code else 0 end) as dxccsr_SYM005,\n \n sum(case when ccsr_category = 'SYM006' then dx_code else 0 end) as dxccsr_SYM006,\n \n sum(case when ccsr_category = 'SYM007' then dx_code else 0 end) as dxccsr_SYM007,\n \n sum(case when ccsr_category = 'SYM008' then dx_code else 0 end) as dxccsr_SYM008,\n \n sum(case when ccsr_category = 'SYM009' then dx_code else 0 end) as dxccsr_SYM009,\n \n sum(case when ccsr_category = 'SYM010' then dx_code else 0 end) as dxccsr_SYM010,\n \n sum(case when ccsr_category = 'SYM011' then dx_code else 0 end) as dxccsr_SYM011,\n \n sum(case when ccsr_category = 'SYM012' then dx_code else 0 end) as dxccsr_SYM012,\n \n sum(case when ccsr_category = 'SYM013' then dx_code else 0 end) as dxccsr_SYM013,\n \n sum(case when ccsr_category = 'SYM014' then dx_code else 0 end) as dxccsr_SYM014,\n \n sum(case when ccsr_category = 'SYM015' then dx_code else 0 end) as dxccsr_SYM015,\n \n sum(case when ccsr_category = 'SYM016' then dx_code else 0 end) as dxccsr_SYM016,\n \n sum(case when ccsr_category = 'SYM017' then dx_code else 0 end) as dxccsr_SYM017,\n \n '2023.1' as dxccsr_version,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom bool_logic\ngroup by encounter_id, claim_id, patient_id, dxccsr_version, tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__wide_procedure_category": {"database": "tuva", "schema": "ccsr", "name": "ccsr__wide_procedure_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__wide_procedure_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__wide_procedure_category.sql", "unique_id": "model.the_tuva_project.ccsr__wide_procedure_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__wide_procedure_category"], "alias": "wide_procedure_category", "checksum": {"name": "sha256", "checksum": "a5a96f417644e7a2fcb1edfb4b2c4a454ecb7824dcd012e5b3e495f4d32b7271"}, "config": {"enabled": true, "alias": "wide_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a row for each input record with a column for every CCSR procedure category. \nEach column contains a value of 0 or 1. These values indicate:\n * 0 \\- The CCSR was not triggered by any ICD-10-PCS code on the input record.\n * 1 \\- The CCSR was triggered by a procedure on the input record. \n\nWhile the CCSR maps to values 0-3, these values require a procedure rank, but no rank is\nincluded in the TUVA procedure model.\n\nThis table doesn't include any category descriptions, but category and parent category descriptions\ncan be found by querying the target column name against the `ccsr_procedure_category_map` intermediate model. \n", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "wide_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466126.5012424, "relation_name": "tuva.ccsr.wide_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set categories_list = dbt_utils.get_column_values(\r\n table=ref(\"ccsr__procedure_category_map\"),\r\n column=\"ccsr_category\",\r\n order_by=\"ccsr_category\"\r\n) %}\r\n\r\nwith dedupe_records as (\r\n\r\n select distinct\r\n encounter_id,\r\n patient_id,\r\n ccsr_category\r\n from {{ ref('ccsr__long_procedure_category') }} \r\n\r\n)\r\n\r\nselect\r\n encounter_id,\r\n patient_id,\r\n -- pivot rows into column values for each possible CCSR category\r\n {% for category in categories_list %}\r\n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\r\n sum(case when ccsr_category = '{{ category }}' then 1 else 0 end) as prccsr_{{ category|lower }},\r\n {% endfor %}\r\n {{ var('prccsr_version') }} as prccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom dedupe_records\r\ngroup by encounter_id, patient_id, prccsr_version, tuva_last_run", "language": "sql", "refs": [["ccsr__procedure_category_map"], ["ccsr__long_procedure_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values"], "nodes": ["model.the_tuva_project.ccsr__procedure_category_map", "model.the_tuva_project.ccsr__long_procedure_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__wide_procedure_category.sql", "compiled": true, "compiled_code": "\n\n\n\nwith dedupe_records as (\n\n select distinct\n encounter_id,\n patient_id,\n ccsr_category\n from tuva.ccsr.long_procedure_category \n\n)\n\nselect\n encounter_id,\n patient_id,\n -- pivot rows into column values for each possible CCSR category\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM001' then 1 else 0 end) as prccsr_adm001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM002' then 1 else 0 end) as prccsr_adm002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM003' then 1 else 0 end) as prccsr_adm003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM004' then 1 else 0 end) as prccsr_adm004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM005' then 1 else 0 end) as prccsr_adm005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM006' then 1 else 0 end) as prccsr_adm006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM007' then 1 else 0 end) as prccsr_adm007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM008' then 1 else 0 end) as prccsr_adm008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM009' then 1 else 0 end) as prccsr_adm009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM010' then 1 else 0 end) as prccsr_adm010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM011' then 1 else 0 end) as prccsr_adm011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM012' then 1 else 0 end) as prccsr_adm012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM013' then 1 else 0 end) as prccsr_adm013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM014' then 1 else 0 end) as prccsr_adm014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM015' then 1 else 0 end) as prccsr_adm015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM016' then 1 else 0 end) as prccsr_adm016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM017' then 1 else 0 end) as prccsr_adm017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM018' then 1 else 0 end) as prccsr_adm018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM019' then 1 else 0 end) as prccsr_adm019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM020' then 1 else 0 end) as prccsr_adm020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM021' then 1 else 0 end) as prccsr_adm021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ADM022' then 1 else 0 end) as prccsr_adm022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR001' then 1 else 0 end) as prccsr_car001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR002' then 1 else 0 end) as prccsr_car002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR003' then 1 else 0 end) as prccsr_car003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR004' then 1 else 0 end) as prccsr_car004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR005' then 1 else 0 end) as prccsr_car005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR006' then 1 else 0 end) as prccsr_car006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR007' then 1 else 0 end) as prccsr_car007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR008' then 1 else 0 end) as prccsr_car008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR009' then 1 else 0 end) as prccsr_car009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR010' then 1 else 0 end) as prccsr_car010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR011' then 1 else 0 end) as prccsr_car011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR012' then 1 else 0 end) as prccsr_car012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR013' then 1 else 0 end) as prccsr_car013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR014' then 1 else 0 end) as prccsr_car014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR015' then 1 else 0 end) as prccsr_car015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR016' then 1 else 0 end) as prccsr_car016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR017' then 1 else 0 end) as prccsr_car017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR018' then 1 else 0 end) as prccsr_car018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR019' then 1 else 0 end) as prccsr_car019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR020' then 1 else 0 end) as prccsr_car020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR021' then 1 else 0 end) as prccsr_car021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR022' then 1 else 0 end) as prccsr_car022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR023' then 1 else 0 end) as prccsr_car023,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR024' then 1 else 0 end) as prccsr_car024,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR025' then 1 else 0 end) as prccsr_car025,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR026' then 1 else 0 end) as prccsr_car026,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR027' then 1 else 0 end) as prccsr_car027,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR028' then 1 else 0 end) as prccsr_car028,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CAR029' then 1 else 0 end) as prccsr_car029,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CHP001' then 1 else 0 end) as prccsr_chp001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS001' then 1 else 0 end) as prccsr_cns001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS002' then 1 else 0 end) as prccsr_cns002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS003' then 1 else 0 end) as prccsr_cns003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS004' then 1 else 0 end) as prccsr_cns004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS005' then 1 else 0 end) as prccsr_cns005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS006' then 1 else 0 end) as prccsr_cns006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS007' then 1 else 0 end) as prccsr_cns007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS008' then 1 else 0 end) as prccsr_cns008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS009' then 1 else 0 end) as prccsr_cns009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS010' then 1 else 0 end) as prccsr_cns010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS011' then 1 else 0 end) as prccsr_cns011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS012' then 1 else 0 end) as prccsr_cns012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS013' then 1 else 0 end) as prccsr_cns013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'CNS014' then 1 else 0 end) as prccsr_cns014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP001' then 1 else 0 end) as prccsr_enp001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP002' then 1 else 0 end) as prccsr_enp002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP003' then 1 else 0 end) as prccsr_enp003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP004' then 1 else 0 end) as prccsr_enp004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP005' then 1 else 0 end) as prccsr_enp005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENP006' then 1 else 0 end) as prccsr_enp006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT001' then 1 else 0 end) as prccsr_ent001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT002' then 1 else 0 end) as prccsr_ent002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT003' then 1 else 0 end) as prccsr_ent003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT004' then 1 else 0 end) as prccsr_ent004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT005' then 1 else 0 end) as prccsr_ent005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT006' then 1 else 0 end) as prccsr_ent006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT007' then 1 else 0 end) as prccsr_ent007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT008' then 1 else 0 end) as prccsr_ent008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT009' then 1 else 0 end) as prccsr_ent009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT010' then 1 else 0 end) as prccsr_ent010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT011' then 1 else 0 end) as prccsr_ent011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT012' then 1 else 0 end) as prccsr_ent012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT013' then 1 else 0 end) as prccsr_ent013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT014' then 1 else 0 end) as prccsr_ent014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT015' then 1 else 0 end) as prccsr_ent015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT016' then 1 else 0 end) as prccsr_ent016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ENT017' then 1 else 0 end) as prccsr_ent017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA001' then 1 else 0 end) as prccsr_esa001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA002' then 1 else 0 end) as prccsr_esa002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA003' then 1 else 0 end) as prccsr_esa003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA004' then 1 else 0 end) as prccsr_esa004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA005' then 1 else 0 end) as prccsr_esa005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA006' then 1 else 0 end) as prccsr_esa006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA007' then 1 else 0 end) as prccsr_esa007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA008' then 1 else 0 end) as prccsr_esa008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA009' then 1 else 0 end) as prccsr_esa009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA010' then 1 else 0 end) as prccsr_esa010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'ESA011' then 1 else 0 end) as prccsr_esa011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST001' then 1 else 0 end) as prccsr_est001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST002' then 1 else 0 end) as prccsr_est002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST003' then 1 else 0 end) as prccsr_est003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST004' then 1 else 0 end) as prccsr_est004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EST005' then 1 else 0 end) as prccsr_est005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EYP001' then 1 else 0 end) as prccsr_eyp001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'EYP002' then 1 else 0 end) as prccsr_eyp002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS001' then 1 else 0 end) as prccsr_frs001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS002' then 1 else 0 end) as prccsr_frs002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS003' then 1 else 0 end) as prccsr_frs003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS004' then 1 else 0 end) as prccsr_frs004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS005' then 1 else 0 end) as prccsr_frs005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS006' then 1 else 0 end) as prccsr_frs006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS007' then 1 else 0 end) as prccsr_frs007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS008' then 1 else 0 end) as prccsr_frs008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS009' then 1 else 0 end) as prccsr_frs009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS010' then 1 else 0 end) as prccsr_frs010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS011' then 1 else 0 end) as prccsr_frs011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS012' then 1 else 0 end) as prccsr_frs012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS013' then 1 else 0 end) as prccsr_frs013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS014' then 1 else 0 end) as prccsr_frs014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'FRS015' then 1 else 0 end) as prccsr_frs015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS001' then 1 else 0 end) as prccsr_gis001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS002' then 1 else 0 end) as prccsr_gis002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS003' then 1 else 0 end) as prccsr_gis003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS004' then 1 else 0 end) as prccsr_gis004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS005' then 1 else 0 end) as prccsr_gis005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS006' then 1 else 0 end) as prccsr_gis006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS007' then 1 else 0 end) as prccsr_gis007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS008' then 1 else 0 end) as prccsr_gis008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS009' then 1 else 0 end) as prccsr_gis009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS010' then 1 else 0 end) as prccsr_gis010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS011' then 1 else 0 end) as prccsr_gis011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS012' then 1 else 0 end) as prccsr_gis012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS013' then 1 else 0 end) as prccsr_gis013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS014' then 1 else 0 end) as prccsr_gis014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS015' then 1 else 0 end) as prccsr_gis015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS016' then 1 else 0 end) as prccsr_gis016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS017' then 1 else 0 end) as prccsr_gis017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS018' then 1 else 0 end) as prccsr_gis018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS019' then 1 else 0 end) as prccsr_gis019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS020' then 1 else 0 end) as prccsr_gis020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS021' then 1 else 0 end) as prccsr_gis021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS022' then 1 else 0 end) as prccsr_gis022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS023' then 1 else 0 end) as prccsr_gis023,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS024' then 1 else 0 end) as prccsr_gis024,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS025' then 1 else 0 end) as prccsr_gis025,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS026' then 1 else 0 end) as prccsr_gis026,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS027' then 1 else 0 end) as prccsr_gis027,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS028' then 1 else 0 end) as prccsr_gis028,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GIS029' then 1 else 0 end) as prccsr_gis029,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR001' then 1 else 0 end) as prccsr_gnr001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR002' then 1 else 0 end) as prccsr_gnr002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR003' then 1 else 0 end) as prccsr_gnr003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR004' then 1 else 0 end) as prccsr_gnr004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR005' then 1 else 0 end) as prccsr_gnr005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR006' then 1 else 0 end) as prccsr_gnr006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR007' then 1 else 0 end) as prccsr_gnr007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR008' then 1 else 0 end) as prccsr_gnr008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR009' then 1 else 0 end) as prccsr_gnr009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'GNR010' then 1 else 0 end) as prccsr_gnr010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP001' then 1 else 0 end) as prccsr_hep001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP002' then 1 else 0 end) as prccsr_hep002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP003' then 1 else 0 end) as prccsr_hep003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP004' then 1 else 0 end) as prccsr_hep004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP005' then 1 else 0 end) as prccsr_hep005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP006' then 1 else 0 end) as prccsr_hep006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP007' then 1 else 0 end) as prccsr_hep007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP008' then 1 else 0 end) as prccsr_hep008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP009' then 1 else 0 end) as prccsr_hep009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP010' then 1 else 0 end) as prccsr_hep010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP011' then 1 else 0 end) as prccsr_hep011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP012' then 1 else 0 end) as prccsr_hep012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'HEP013' then 1 else 0 end) as prccsr_hep013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG001' then 1 else 0 end) as prccsr_img001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG002' then 1 else 0 end) as prccsr_img002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG003' then 1 else 0 end) as prccsr_img003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG004' then 1 else 0 end) as prccsr_img004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG005' then 1 else 0 end) as prccsr_img005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG006' then 1 else 0 end) as prccsr_img006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG007' then 1 else 0 end) as prccsr_img007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG008' then 1 else 0 end) as prccsr_img008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG009' then 1 else 0 end) as prccsr_img009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'IMG010' then 1 else 0 end) as prccsr_img010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM001' then 1 else 0 end) as prccsr_lym001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM002' then 1 else 0 end) as prccsr_lym002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM003' then 1 else 0 end) as prccsr_lym003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM004' then 1 else 0 end) as prccsr_lym004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM005' then 1 else 0 end) as prccsr_lym005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM006' then 1 else 0 end) as prccsr_lym006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM007' then 1 else 0 end) as prccsr_lym007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM008' then 1 else 0 end) as prccsr_lym008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM009' then 1 else 0 end) as prccsr_lym009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM010' then 1 else 0 end) as prccsr_lym010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'LYM011' then 1 else 0 end) as prccsr_lym011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM001' then 1 else 0 end) as prccsr_mam001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM002' then 1 else 0 end) as prccsr_mam002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM003' then 1 else 0 end) as prccsr_mam003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM004' then 1 else 0 end) as prccsr_mam004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM005' then 1 else 0 end) as prccsr_mam005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM006' then 1 else 0 end) as prccsr_mam006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM007' then 1 else 0 end) as prccsr_mam007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM008' then 1 else 0 end) as prccsr_mam008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM009' then 1 else 0 end) as prccsr_mam009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM010' then 1 else 0 end) as prccsr_mam010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM011' then 1 else 0 end) as prccsr_mam011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM012' then 1 else 0 end) as prccsr_mam012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM013' then 1 else 0 end) as prccsr_mam013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM014' then 1 else 0 end) as prccsr_mam014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MAM015' then 1 else 0 end) as prccsr_mam015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT001' then 1 else 0 end) as prccsr_mht001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT002' then 1 else 0 end) as prccsr_mht002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT003' then 1 else 0 end) as prccsr_mht003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT004' then 1 else 0 end) as prccsr_mht004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MHT005' then 1 else 0 end) as prccsr_mht005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS001' then 1 else 0 end) as prccsr_mrs001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS002' then 1 else 0 end) as prccsr_mrs002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS003' then 1 else 0 end) as prccsr_mrs003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS004' then 1 else 0 end) as prccsr_mrs004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS005' then 1 else 0 end) as prccsr_mrs005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS006' then 1 else 0 end) as prccsr_mrs006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MRS007' then 1 else 0 end) as prccsr_mrs007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST001' then 1 else 0 end) as prccsr_mst001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST002' then 1 else 0 end) as prccsr_mst002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST003' then 1 else 0 end) as prccsr_mst003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST004' then 1 else 0 end) as prccsr_mst004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST005' then 1 else 0 end) as prccsr_mst005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST006' then 1 else 0 end) as prccsr_mst006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST007' then 1 else 0 end) as prccsr_mst007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST008' then 1 else 0 end) as prccsr_mst008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST009' then 1 else 0 end) as prccsr_mst009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST010' then 1 else 0 end) as prccsr_mst010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST011' then 1 else 0 end) as prccsr_mst011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST012' then 1 else 0 end) as prccsr_mst012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST013' then 1 else 0 end) as prccsr_mst013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST014' then 1 else 0 end) as prccsr_mst014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST015' then 1 else 0 end) as prccsr_mst015,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST016' then 1 else 0 end) as prccsr_mst016,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST017' then 1 else 0 end) as prccsr_mst017,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST018' then 1 else 0 end) as prccsr_mst018,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST019' then 1 else 0 end) as prccsr_mst019,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST020' then 1 else 0 end) as prccsr_mst020,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST021' then 1 else 0 end) as prccsr_mst021,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST022' then 1 else 0 end) as prccsr_mst022,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST023' then 1 else 0 end) as prccsr_mst023,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST024' then 1 else 0 end) as prccsr_mst024,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST025' then 1 else 0 end) as prccsr_mst025,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST026' then 1 else 0 end) as prccsr_mst026,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST027' then 1 else 0 end) as prccsr_mst027,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST028' then 1 else 0 end) as prccsr_mst028,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST029' then 1 else 0 end) as prccsr_mst029,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'MST030' then 1 else 0 end) as prccsr_mst030,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM001' then 1 else 0 end) as prccsr_ncm001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM002' then 1 else 0 end) as prccsr_ncm002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM003' then 1 else 0 end) as prccsr_ncm003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'NCM004' then 1 else 0 end) as prccsr_ncm004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OST001' then 1 else 0 end) as prccsr_ost001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR001' then 1 else 0 end) as prccsr_otr001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR002' then 1 else 0 end) as prccsr_otr002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR003' then 1 else 0 end) as prccsr_otr003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR004' then 1 else 0 end) as prccsr_otr004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'OTR005' then 1 else 0 end) as prccsr_otr005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN001' then 1 else 0 end) as prccsr_pgn001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN002' then 1 else 0 end) as prccsr_pgn002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN003' then 1 else 0 end) as prccsr_pgn003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN004' then 1 else 0 end) as prccsr_pgn004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN005' then 1 else 0 end) as prccsr_pgn005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN006' then 1 else 0 end) as prccsr_pgn006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN007' then 1 else 0 end) as prccsr_pgn007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN008' then 1 else 0 end) as prccsr_pgn008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PGN009' then 1 else 0 end) as prccsr_pgn009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PLC001' then 1 else 0 end) as prccsr_plc001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PLC002' then 1 else 0 end) as prccsr_plc002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS001' then 1 else 0 end) as prccsr_pns001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS002' then 1 else 0 end) as prccsr_pns002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS003' then 1 else 0 end) as prccsr_pns003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS004' then 1 else 0 end) as prccsr_pns004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS005' then 1 else 0 end) as prccsr_pns005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'PNS006' then 1 else 0 end) as prccsr_pns006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD001' then 1 else 0 end) as prccsr_rad001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD002' then 1 else 0 end) as prccsr_rad002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD003' then 1 else 0 end) as prccsr_rad003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RAD004' then 1 else 0 end) as prccsr_rad004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES001' then 1 else 0 end) as prccsr_res001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES002' then 1 else 0 end) as prccsr_res002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES003' then 1 else 0 end) as prccsr_res003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES004' then 1 else 0 end) as prccsr_res004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES005' then 1 else 0 end) as prccsr_res005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES006' then 1 else 0 end) as prccsr_res006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES007' then 1 else 0 end) as prccsr_res007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES008' then 1 else 0 end) as prccsr_res008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES009' then 1 else 0 end) as prccsr_res009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES010' then 1 else 0 end) as prccsr_res010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES011' then 1 else 0 end) as prccsr_res011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES012' then 1 else 0 end) as prccsr_res012,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES013' then 1 else 0 end) as prccsr_res013,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RES014' then 1 else 0 end) as prccsr_res014,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB001' then 1 else 0 end) as prccsr_rhb001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB002' then 1 else 0 end) as prccsr_rhb002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB003' then 1 else 0 end) as prccsr_rhb003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'RHB004' then 1 else 0 end) as prccsr_rhb004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB001' then 1 else 0 end) as prccsr_skb001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB002' then 1 else 0 end) as prccsr_skb002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB003' then 1 else 0 end) as prccsr_skb003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB004' then 1 else 0 end) as prccsr_skb004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB005' then 1 else 0 end) as prccsr_skb005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB006' then 1 else 0 end) as prccsr_skb006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB007' then 1 else 0 end) as prccsr_skb007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB008' then 1 else 0 end) as prccsr_skb008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB009' then 1 else 0 end) as prccsr_skb009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SKB010' then 1 else 0 end) as prccsr_skb010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD001' then 1 else 0 end) as prccsr_sud001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD002' then 1 else 0 end) as prccsr_sud002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD003' then 1 else 0 end) as prccsr_sud003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'SUD004' then 1 else 0 end) as prccsr_sud004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN001' then 1 else 0 end) as prccsr_urn001,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN002' then 1 else 0 end) as prccsr_urn002,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN003' then 1 else 0 end) as prccsr_urn003,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN004' then 1 else 0 end) as prccsr_urn004,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN005' then 1 else 0 end) as prccsr_urn005,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN006' then 1 else 0 end) as prccsr_urn006,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN007' then 1 else 0 end) as prccsr_urn007,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN008' then 1 else 0 end) as prccsr_urn008,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN009' then 1 else 0 end) as prccsr_urn009,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN010' then 1 else 0 end) as prccsr_urn010,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN011' then 1 else 0 end) as prccsr_urn011,\n \n -- as we don't rank procedure codes, we encode to 0 or 1 instead of 0-3\n sum(case when ccsr_category = 'URN012' then 1 else 0 end) as prccsr_urn012,\n \n '2023.1' as prccsr_version,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom dedupe_records\ngroup by encounter_id, patient_id, prccsr_version, tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"database": "tuva", "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": "6b64bb5700551524c1025679e96a99945c531aac89d6377531a44700e854812a"}, "config": {"enabled": true, "alias": "dx_vertical_pivot", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "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, "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, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.4692914, "relation_name": "tuva.ccsr.dx_vertical_pivot", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__dxccsr_v2023_1_cleaned_map"]], "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 tuva.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 '2023-09-12 13:15:18.296145+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": []}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "tuva", "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": "d759906e0f8f156c9796b7b571bafb6795e66c80f993f8758edaab57226eeb2a"}, "config": {"enabled": true, "alias": "procedure_category_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.4732766, "relation_name": "tuva.ccsr.procedure_category_map", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["ccsr__prccsr_v2023_1_cleaned_map"]], "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 '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "58bfbd6d39695f1589b0cdb3e898932d48e10765563ac69c3489e1094b0e1a15"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.5021946, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "tuva", "schema": "claims_data_model", "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": "44d8ae3e59950ce973f04cc24eb71d41efb4fcd04e1ab181ffade1ef71e5b626"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.5042493, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "tuva", "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": "b4641588f45258fe5df14e4e2e5d139d33a97d5da7a0c0a960fa43571e798a8c"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.5531867, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_all"], ["chronic_conditions__cms_chronic_conditions_hiv_aids"], ["chronic_conditions__cms_chronic_conditions_oud"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\n union distinct\n select * from tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\n union distinct\n select * from tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "tuva", "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": "9ea114b7ec20cfd07cca20bc83b57cc325759c758f8fe4014ed1fbf68c374d84"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "adhd_conduct_disorders_and_hyperkinetic_syndrome": {"name": "adhd_conduct_disorders_and_hyperkinetic_syndrome", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_urologic_kidney_renal_pelvis_and_ureter": {"name": "cancer_urologic_kidney_renal_pelvis_and_ureter", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis_and_other_metabolic_developmental_disorders": {"name": "cystic_fibrosis_and_other_metabolic_developmental_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression_bipolar_or_other_depressive_mood_disorders": {"name": "depression_bipolar_or_other_depressive_mood_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "fibromyalgia_and_chronic_pain_and_fatigue": {"name": "fibromyalgia_and_chronic_pain_and_fatigue", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure_and_non_ischemic_heart_disease": {"name": "heart_failure_and_non_ischemic_heart_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_acute_or_unspecified": {"name": "hepatitis_b_acute_or_unspecified", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "intellectual_disabilities_and_related_conditions": {"name": "intellectual_disabilities_and_related_conditions", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis_and_transverse_myelitis": {"name": "multiple_sclerosis_and_transverse_myelitis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "osteoporosis_with_or_without_pathological_fracture": {"name": "osteoporosis_with_or_without_pathological_fracture", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease_and_secondary_parkinsonism": {"name": "parkinsons_disease_and_secondary_parkinsonism", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder_ptsd": {"name": "post_traumatic_stress_disorder_ptsd", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia_and_other_psychotic_disorders": {"name": "schizophrenia_and_other_psychotic_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_blindness_and_visual_impairment": {"name": "sensory_blindness_and_visual_impairment", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_deafness_and_hearing_impairment": {"name": "sensory_deafness_and_hearing_impairment", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.548199, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["chronic_conditions__cms_chronic_conditions_long"], ["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n),chronic_conditions as (\n\n select distinct\n condition\n , condition_column_name\n from tuva.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 tuva.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 , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "tuva", "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": "32f68515d0321c809f2b8aa8d05a563409368b385ef47fcea40c3a7ac6872061"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.6146474, "relation_name": "tuva.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))))\r\n )\r\n}}\r\n\r\nwith condition_row_number as (\r\n\r\n select \r\n patient_id\r\n , normalized_code\r\n , recorded_date\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , normalized_code\r\n order by recorded_date asc\r\n ) as rn_asc\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , normalized_code\r\n order by recorded_date desc\r\n ) as rn_desc\r\n from {{ ref('tuva_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select \r\n patient_id\r\n , normalized_code as icd_10_cm\r\n , max(\r\n case\r\n when rn_asc = 1\r\n then recorded_date\r\n end\r\n ) as first_diagnosis_date\r\n , max(\r\n case\r\n when rn_desc = 1\r\n then recorded_date\r\n end\r\n ) as last_diagnosis_date\r\n from condition_row_number\r\n group by \r\n patient_id\r\n , normalized_code\r\n\r\n)\r\n\r\nselect \r\n pc.patient_id\r\n , h.condition_family\r\n , h.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 {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }} h\r\n inner join patient_conditions pc\r\n on h.icd_10_cm_code = pc.icd_10_cm\r\ngroup by \r\n pc.patient_id\r\n , h.condition_family\r\n , h.condition", "language": "sql", "refs": [["tuva_chronic_conditions__stg_core__condition"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"]}, "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n),condition_row_number as (\n\n select \n patient_id\n , normalized_code\n , recorded_date\n , row_number() over(\n partition by\n patient_id\n , normalized_code\n order by recorded_date asc\n ) as rn_asc\n , row_number() over(\n partition by\n patient_id\n , normalized_code\n order by recorded_date desc\n ) as rn_desc\n from __dbt__cte__tuva_chronic_conditions__stg_core__condition\n\n)\n\n, patient_conditions as (\n\n select \n patient_id\n , normalized_code as icd_10_cm\n , max(\n case\n when rn_asc = 1\n then recorded_date\n end\n ) as first_diagnosis_date\n , max(\n case\n when rn_desc = 1\n then recorded_date\n end\n ) as last_diagnosis_date\n from condition_row_number\n group by \n patient_id\n , normalized_code\n\n)\n\nselect \n pc.patient_id\n , h.condition_family\n , h.condition\n , min(first_diagnosis_date) as first_diagnosis_date\n , max(last_diagnosis_date) as last_diagnosis_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy h\n inner join patient_conditions pc\n on h.icd_10_cm_code = pc.icd_10_cm\ngroup by \n pc.patient_id\n , h.condition_family\n , h.condition", "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}]}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "tuva", "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": "dbafd459550d5c36fc38a417f517e896e772b6ab45d04ab8ffd6a293db958670"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.636053, "relation_name": "tuva.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))))\r\n )\r\n}}\r\n\r\nwith condition_columns as (\r\n\r\n select distinct\r\n condition\r\n , condition_column_name\r\n from {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\nselect\r\n p.patient_id\r\n , {{ dbt_utils.pivot(\r\n column='cc.condition_column_name'\r\n , values=dbt_utils.get_column_values(\r\n ref('chronic_conditions__tuva_chronic_conditions_hierarchy')\r\n , 'condition_column_name'\r\n ,'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('tuva_chronic_conditions__stg_core__patient') }} p\r\n left join {{ ref('chronic_conditions__tuva_chronic_conditions_long') }} l\r\n on p.patient_id = l.patient_id\r\n left join condition_columns cc\r\n on l.condition = cc.condition\r\ngroup by\r\n p.patient_id", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["tuva_chronic_conditions__stg_core__patient"], ["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "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 __dbt__cte__tuva_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n),condition_columns as (\n\n select distinct\n condition\n , condition_column_name\n from tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy\n\n)\n\nselect\n p.patient_id\n , \n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'ALCOHOL'\n then 1\n else 0\n end\n )\n \n \n as alcohol\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'AMYOTROPHIC_LATERAL_SCLEROSIS'\n then 1\n else 0\n end\n )\n \n \n as amyotrophic_lateral_sclerosis\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ANXIETY'\n then 1\n else 0\n end\n )\n \n \n as anxiety\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'ATHEROSCLEROSIS'\n then 1\n else 0\n end\n )\n \n \n as atherosclerosis\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ATRIAL_FIBRILLATION'\n then 1\n else 0\n end\n )\n \n \n as atrial_fibrillation\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ATTENTION_DEFICIT_HYPERACTIVITY_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as attention_deficit_hyperactivity_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'BIPOLAR'\n then 1\n else 0\n end\n )\n \n \n as bipolar\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'BREAST_CANCER'\n then 1\n else 0\n end\n )\n \n \n as breast_cancer\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.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 cc.condition_column_name = 'COCAINE'\n then 1\n else 0\n end\n )\n \n \n as cocaine\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'COLORECTAL_CANCER'\n then 1\n else 0\n end\n )\n \n \n as colorectal_cancer\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'CROHNS_DISEASE'\n then 1\n else 0\n end\n )\n \n \n as crohns_disease\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'CYSTIC_FIBROSIS'\n then 1\n else 0\n end\n )\n \n \n as cystic_fibrosis\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'DEMENTIA'\n then 1\n else 0\n end\n )\n \n \n as dementia\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'DEPRESSION'\n then 1\n else 0\n end\n )\n \n \n as depression\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'HEART_FAILURE'\n then 1\n else 0\n end\n )\n \n \n as heart_failure\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.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 cc.condition_column_name = 'LUNG_CANCER'\n then 1\n else 0\n end\n )\n \n \n as lung_cancer\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'LUPUS'\n then 1\n else 0\n end\n )\n \n \n as lupus\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'METABOLIC_SYNDROME'\n then 1\n else 0\n end\n )\n \n \n as metabolic_syndrome\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'MULTIPLE_SCLEROSIS'\n then 1\n else 0\n end\n )\n \n \n as multiple_sclerosis\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.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 cc.condition_column_name = 'OBSESSIVE_COMPULSIVE_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as obsessive_compulsive_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'OPIOID'\n then 1\n else 0\n end\n )\n \n \n as opioid\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'PARKINSONS_DISEASE'\n then 1\n else 0\n end\n )\n \n \n as parkinsons_disease\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'PERSONALITY_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as personality_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'POST_TRAUMATIC_STRESS_DISORDER'\n then 1\n else 0\n end\n )\n \n \n as post_traumatic_stress_disorder\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'RHEUMATOID_ARTHRITIS'\n then 1\n else 0\n end\n )\n \n \n as rheumatoid_arthritis\n \n \n ,\n \n max(\n \n case\n when cc.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 cc.condition_column_name = 'STROKE'\n then 1\n else 0\n end\n )\n \n \n as stroke\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'TOBACCO'\n then 1\n else 0\n end\n )\n \n \n as tobacco\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'TYPE_1_DIABETES'\n then 1\n else 0\n end\n )\n \n \n as type_1_diabetes\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'TYPE_2_DIABETES'\n then 1\n else 0\n end\n )\n \n \n as type_2_diabetes\n \n \n ,\n \n max(\n \n case\n when cc.condition_column_name = 'ULCERATIVE_COLITIS'\n then 1\n else 0\n end\n )\n \n \n as ulcerative_colitis\n \n \n \n \n\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__tuva_chronic_conditions__stg_core__patient p\n left join tuva.chronic_conditions.tuva_chronic_conditions_long l\n on p.patient_id = l.patient_id\n left join condition_columns cc\n on l.condition = cc.condition\ngroup by\n p.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "sql": " __dbt__cte__tuva_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"database": "tuva", "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": "4066b0b7caf3a140a892da8303ed785c9970171825cdfb038f8f2fc0db06368e"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_all", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.5576768, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"], ["cms_chronic_conditions__stg_core__procedure"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),chronic_conditions as (\n\n select * from tuva.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 , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "tuva", "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": "650c4fd2c4e598a83cce3814a54ba40588aeb532c40567366cb6535b002a125f"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_hiv_aids", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.5637846, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),chronic_conditions as (\n\n select * from tuva.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 , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "tuva", "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": "0edbbe01903e631fdff00a390367aea7fcfff5ec1a5454994a1c357bb42f4df5"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_oud", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.5685208, "relation_name": "tuva.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)))\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": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_pharmacy_claim"], ["cms_chronic_conditions__stg_core__procedure"], ["chronic_conditions__cms_chronic_conditions_all"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),chronic_conditions as (\n\n select * from tuva.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 tuva.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 , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "14bc859c362a0bf063c1f1b5573c4c3c579fe36fd016b68a559c9d342ad97a8a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.5705874, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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') }}", "language": "sql", "refs": [["core__condition"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "claims_data_model", "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": "c1179facf8d0fe84d23bb48595d8788b7ea24239af870f2765aeda6b3202b689"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.571587, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "tuva", "schema": "claims_data_model", "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": "a2edc7f43347634a329a5572d5f6d1070cb7b922b028572a264d75b6574765f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.573574, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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') }}", "language": "sql", "refs": [["core__procedure"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "837370350f0cfe6af7920826ec0af6ad83b3c1e27127cfdf58e08341fcaa0257"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.5755687, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "tuva", "schema": "claims_data_model", "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": "31b3681bfce9e02877c6b2a296a731d66d53751cec210a6ee7367f78271c1198"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.578089, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "48dd1d737654e1702b462ae927368771052d05c66bd16365187e51f67470f5ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.6386611, "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))))\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": [["core__condition"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "claims_data_model", "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": "1f922ebd0ff235d61d3cecfacf5b7fb056cf6b55b1dc14c054df6b07b38e4a0b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "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": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "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": "#2e0e0e"}}, "created_at": 1694466126.639625, "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))))\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": [["core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__summary": {"database": "tuva", "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": "c8464ad078ee837af7f0b3ca7110acb6669e1c96ee12a48bdf3fae13893b63b5"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "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, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6557715, "relation_name": "tuva.claims_preprocessing.acute_inpatient_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('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\nselect\r\n b.encounter_id\r\n, max(a.facility_npi) as facility_npi\r\n, max(ms_drg_code) as ms_drg_code\r\n, max(apr_drg_code) as apr_drg_code\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, 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\nfrom {{ ref('medical_claim') }} a\r\ninner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_type = 'institutional'\r\ngroup by 1\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('acute_inpatient__stg_medical_claim') }} a\r\ninner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\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('acute_inpatient__stg_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('acute_inpatient__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, 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 + d.prof_paid_amount as total_paid_amount\r\n, c.inst_allowed_amount + d.prof_allowed_amount as total_allowed_amount\r\n, c.inst_charge_amount + d.prof_charge_amount 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", "language": "sql", "refs": [["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"], ["medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__stg_eligibility"], ["acute_inpatient__institutional_encounter_id"], ["terminology__provider"], ["terminology__discharge_disposition"], ["terminology__admit_source"], ["terminology__admit_type"], ["terminology__ms_drg"], ["terminology__apr_drg"]], "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.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "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"]}, "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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__acute_inpatient__stg_eligibility as (\n\n\nselect\n patient_id\n, birth_date\n, gender\n, race\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n),distinct_encounters as (\nselect distinct\n a.encounter_id\n, a.patient_id\n, b.encounter_start_date\n, b.encounter_end_date\nfrom tuva.claims_preprocessing._int_acute_inpatient_encounter_id a\ninner join tuva.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 (\nselect\n b.encounter_id\n, max(a.facility_npi) as facility_npi\n, max(ms_drg_code) as ms_drg_code\n, max(apr_drg_code) as apr_drg_code\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, 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\nfrom tuva.claims_data_model.medical_claim a\ninner join tuva.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_type = 'institutional'\ngroup by 1\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 __dbt__cte__acute_inpatient__stg_medical_claim a\ninner join tuva.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\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 __dbt__cte__acute_inpatient__stg_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 tuva.claims_preprocessing._int_acute_inpatient_institutional_encounter_id a\nleft join tuva.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, 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 + d.prof_paid_amount as total_paid_amount\n, c.inst_allowed_amount + d.prof_allowed_amount as total_allowed_amount\n, c.inst_charge_amount + d.prof_charge_amount 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, '2023-09-12 13:15:18.296145+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 tuva.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join tuva.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join tuva.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join tuva.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join tuva.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code", "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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}]}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "tuva", "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": "ab00894727d4eecd7ecf78a6182ddfc159c3138154a556548aac139e1414203f"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6753788, "relation_name": "tuva.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)))\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": [["acute_inpatient__institutional_claims"], ["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"]], "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 tuva.claims_preprocessing._int_acute_inpatient_institutional_claims aa\n\nleft join\ntuva.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\ntuva.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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "tuva", "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": "2769efc3ae1d7465fafb2afef5c686d9f2e66cb61006a02ea0350c6a0eeb7653"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6619925, "relation_name": "tuva.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)))\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": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"]], "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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 tuva.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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "tuva", "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": "a25796e8c81144e4f18d2391087fed8d9e9a18a98c8627e917a4ac528662c509"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6805775, "relation_name": "tuva.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)))\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": [["acute_inpatient__claims_with_encounter_data"], ["acute_inpatient__professional_encounter_id"]], "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 tuva.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 tuva.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\n)\n\n\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "tuva", "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": "ebd088e091541cd15b3079f9cd9e92371e2e648ba6d9d6366553076442ab0b7f"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6733854, "relation_name": "tuva.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)))\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 patient_id,\r\n claim_id,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__institutional_encounter_id') }}\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\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": [["acute_inpatient__institutional_encounter_id"], ["acute_inpatient__professional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "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\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 patient_id,\n claim_id,\n encounter_id,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_acute_inpatient_institutional_encounter_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n encounter_id,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "tuva", "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": "3f0ba7f0ffb340f3c524ae7a446676747762352ca7d26a2604c3e41a783752de"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6673996, "relation_name": "tuva.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)))\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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_encounter_id"]], "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 tuva.claims_preprocessing._int_acute_inpatient_institutional_claims aip\nleft join tuva.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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"database": "tuva", "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": "3d7f56d20d98870baaa591c2de7b47f5b56ef654638c05cd5a59eaee1f896c19"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "All acute inpatient institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6583986, "relation_name": "tuva.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)))\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__service_category_grouper')}} 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": [["acute_inpatient__stg_medical_claim"], ["acute_inpatient__stg_service_category__service_category_grouper"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper"]}, "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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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__service_category_grouper 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 '2023-09-12 13:15:18.296145+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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper", "sql": " __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper\n)"}]}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "tuva", "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": "1baaa1b09d4afdf40bd98eccfa3cda55d0c489532b292e686babab51ee31405e"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6656773, "relation_name": "tuva.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)))\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 (aa.end_date + 1 = 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": [["acute_inpatient__institutional_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "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 tuva.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 (aa.end_date + 1 = 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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"database": "tuva", "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": "a87281a82f378944f9d5f0fd584a70a0199fe2c8b418c877f54ad64a2863328c"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6703954, "relation_name": "tuva.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)))\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 claim_id\r\nfrom {{ ref('acute_inpatient__stg_service_category__service_category_grouper') }} \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.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),\r\n\r\n\r\nacute_inpatient_professional_claim_dates as (\r\nselect\r\n claim_id,\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, 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.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 (aa.start_date between bb.encounter_start_date and bb.encounter_end_date)\r\n and (aa.end_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 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\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.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.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 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 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": [["acute_inpatient__stg_service_category__service_category_grouper"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_start_and_end_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper", "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__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),acute_inpatient_professional_claim_ids as (\nselect distinct claim_id\nfrom __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper \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.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),\n\n\nacute_inpatient_professional_claim_dates as (\nselect\n claim_id,\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, patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\nselect\n aa.patient_id,\n aa.claim_id,\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 tuva.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (aa.start_date between bb.encounter_start_date and bb.encounter_end_date)\n and (aa.end_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 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\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.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.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 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 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 *, '2023-09-12 13:15:18.296145+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__service_category_grouper", "sql": " __dbt__cte__acute_inpatient__stg_service_category__service_category_grouper as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "tuva", "schema": "claims_data_model", "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": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "2ff7c8bcfa4a92ed7c706b5ba9837ab9f73ace3b51ddb4a17697b0f89f532d37"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_eligibility", "tags": "acute_inpatient", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6825705, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "c830558bd8993dcb25434dc80de7850519dc42e8c6585bcc760408af37ac8b22"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_medical_claim", "tags": "acute_inpatient", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.6845825, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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, data_source\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper": {"database": "tuva", "schema": "claims_data_model", "name": "acute_inpatient__stg_service_category__service_category_grouper", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category__service_category_grouper.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category__service_category_grouper.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_service_category__service_category_grouper"], "alias": "_stg_service_category__service_category_grouper", "checksum": {"name": "sha256", "checksum": "3676c36074683e2d13b6e3100e947b7560120103e6d2eb7a83b24b7fd4eae94f"}, "config": {"enabled": true, "alias": "_stg_service_category__service_category_grouper", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_service_category__service_category_grouper", "tags": "acute_inpatient", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466126.685638, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\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": [["service_category__service_category_grouper"]], "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__service_category_grouper.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__claims_without_enrollment", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "final", "claims_date_profiling__claims_without_enrollment"], "alias": "claims_without_enrollment", "checksum": {"name": "sha256", "checksum": "c554b293c33b83e1b41c8e6234ed764e68da9b489daeae16b6e9b87f2d654d0d"}, "config": {"enabled": true, "alias": "claims_without_enrollment", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "claims_without_enrollment", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.792908, "relation_name": "tuva.claims_preprocessing.claims_without_enrollment", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n 'medical claims without enrollment' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} a\r\nleft join {{ ref('eligibility') }} b\r\n on a.patient_id = b.patient_id\r\nwhere b.patient_id is null\r\n\r\nunion all\r\n\r\nselect \r\n 'rx claims without enrollment' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }} a\r\nleft join {{ ref('eligibility') }} b\r\n on a.patient_id = b.patient_id\r\nwhere b.patient_id is null", "language": "sql", "refs": [["medical_claim"], ["eligibility"], ["pharmacy_claim"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.eligibility", "model.claims_data_model.pharmacy_claim", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__claims_without_enrollment.sql", "compiled": true, "compiled_code": "\n\nselect \n 'medical claims without enrollment' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim a\nleft join tuva.claims_data_model.eligibility b\n on a.patient_id = b.patient_id\nwhere b.patient_id is null\n\nunion all\n\nselect \n 'rx claims without enrollment' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim a\nleft join tuva.claims_data_model.eligibility b\n on a.patient_id = b.patient_id\nwhere b.patient_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__date_issues": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__date_issues", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__date_issues", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "final", "claims_date_profiling__date_issues"], "alias": "date_issues", "checksum": {"name": "sha256", "checksum": "25f59960ed65bc53ff9990bfe215344912fe31e04df088551032706ae5f531ce"}, "config": {"enabled": true, "alias": "date_issues", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "date_issues", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7899876, "relation_name": "tuva.claims_preprocessing.date_issues", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'claim_start_date > claim_end_date' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere claim_start_date > claim_end_date\r\n\r\nunion all\r\n\r\nselect\r\n 'admission_date > discharge_date' as test_description\r\n, count(distinct claim_id) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere admission_date > discharge_date\r\n\r\nunion all\r\n\r\nselect\r\n 'enrollment_start_date > enrollment_end_date' as test_description\r\n, count(1) as claim_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }} \r\nwhere enrollment_start_date > enrollment_end_date", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_issues.sql", "compiled": true, "compiled_code": "\n\nselect\n 'claim_start_date > claim_end_date' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \nwhere claim_start_date > claim_end_date\n\nunion all\n\nselect\n 'admission_date > discharge_date' as test_description\n, count(distinct claim_id) as claim_count\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \nwhere admission_date > discharge_date\n\nunion all\n\nselect\n 'enrollment_start_date > enrollment_end_date' as test_description\n, count(1) as claim_count\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility \nwhere enrollment_start_date > enrollment_end_date", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__date_summary": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__date_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__date_summary", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "final", "claims_date_profiling__date_summary"], "alias": "date_summary", "checksum": {"name": "sha256", "checksum": "76b909198cffd355de04074214501c4e5343aaddb354ffbf844b96895ab9522b"}, "config": {"enabled": true, "alias": "date_summary", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "date_summary", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7873385, "relation_name": "tuva.claims_preprocessing.date_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n coalesce(a.year_month,b.year_month) as year_month\r\n, a.claim_start_date as claim_start_date\r\n, a.claim_end_date as claim_end_date\r\n, a.admission_date as admission_date\r\n, a.discharge_date as discharge_date\r\n, a.paid_date as medical_paid_date\r\n, b.dispensing_date as dispensing_date\r\n, b.paid_date as rx_paid_date\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('claims_date_profiling__medical_claim_dates') }} a\r\nfull join {{ ref('claims_date_profiling__pharmacy_claim_dates') }} b\r\n on a.year_month = b.year_month\r\n\r\nunion all\r\n\r\nselect \r\n 'Duplicate' as year_month\r\n, c.claim_start_date\r\n, c.claim_end_date\r\n, c.admission_date\r\n, c.discharge_date\r\n, c.med_paid_date as medical_paid_date\r\n, c.dispensing_date\r\n, c.rx_paid_date\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('claims_date_profiling__duplicate_dates') }} c\r\norder by 1", "language": "sql", "refs": [["claims_date_profiling__medical_claim_dates"], ["claims_date_profiling__pharmacy_claim_dates"], ["claims_date_profiling__duplicate_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.claims_date_profiling__medical_claim_dates", "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\final\\claims_date_profiling__date_summary.sql", "compiled": true, "compiled_code": "\n\nselect\n coalesce(a.year_month,b.year_month) as year_month\n, a.claim_start_date as claim_start_date\n, a.claim_end_date as claim_end_date\n, a.admission_date as admission_date\n, a.discharge_date as discharge_date\n, a.paid_date as medical_paid_date\n, b.dispensing_date as dispensing_date\n, b.paid_date as rx_paid_date\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_medical_claim_dates a\nfull join tuva.claims_preprocessing._int_pharmacy_claim_dates b\n on a.year_month = b.year_month\n\nunion all\n\nselect \n 'Duplicate' as year_month\n, c.claim_start_date\n, c.claim_end_date\n, c.admission_date\n, c.discharge_date\n, c.med_paid_date as medical_paid_date\n, c.dispensing_date\n, c.rx_paid_date\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_duplicate_dates c\norder by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__duplicate_dates": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__duplicate_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__duplicate_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "intermediate", "claims_date_profiling__duplicate_dates"], "alias": "_int_duplicate_dates", "checksum": {"name": "sha256", "checksum": "7f3fc6cdce6da981afb5382efb22597ad2a08a7573124f384125b0ec71409325"}, "config": {"enabled": true, "alias": "_int_duplicate_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "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_dates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7843516, "relation_name": "tuva.claims_preprocessing._int_duplicate_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_start as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct claim_start_date) > 1\r\n)\r\n\r\n, claim_end as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct claim_end_date) > 1\r\n)\r\n\r\n, admission_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct admission_date) > 1\r\n)\r\n\r\n, discharge_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct discharge_date) > 1\r\n)\r\n\r\n, med_paid_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct paid_date) > 1\r\n)\r\n\r\n, dispensing_date as (\r\nselect claim_id\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct dispensing_date) > 1\r\n)\r\n\r\n, rx_paid_date as (\r\nselect claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\nhaving count(distinct paid_date) > 1\r\n)\r\n\r\n, combine as (\r\nselect \r\n 'claim_start_date' as date_type\r\n, count(1) as cnt\r\nfrom claim_start\r\n\r\nunion all\r\n\r\nselect \r\n 'claim_end_date' as date_type\r\n, count(1) as cnt\r\nfrom claim_end\r\n\r\nunion all\r\n\r\nselect \r\n 'admission_date' as date_type\r\n, count(1) as cnt\r\nfrom admission_date\r\n\r\nunion all\r\n\r\nselect \r\n 'discharge_date' as date_type\r\n, count(1) as cnt\r\nfrom discharge_date\r\n\r\nunion all\r\n\r\nselect \r\n 'med_paid_date' as date_type\r\n, count(1) as cnt\r\nfrom med_paid_date\r\n\r\nunion all\r\n\r\nselect \r\n 'dispensing_date' as date_type\r\n, count(1) as cnt\r\nfrom dispensing_date\r\n\r\nunion all\r\n\r\nselect \r\n 'rx_paid_date' as date_type\r\n, count(1) as cnt\r\nfrom rx_paid_date\r\n)\r\n\r\nselect\r\n {{ dbt_utils.pivot(\r\n column='date_type'\r\n , values=('claim_start_date',\r\n 'claim_end_date',\r\n 'admission_date',\r\n 'discharge_date',\r\n 'med_paid_date',\r\n 'dispensing_date',\r\n 'rx_paid_date'\r\n )\r\n , agg='sum'\r\n , then_value='cnt'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine\r\norder by 1", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["pharmacy_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__duplicate_dates.sql", "compiled": true, "compiled_code": "\n\nwith claim_start as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct claim_start_date) > 1\n)\n\n, claim_end as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct claim_end_date) > 1\n)\n\n, admission_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct admission_date) > 1\n)\n\n, discharge_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct discharge_date) > 1\n)\n\n, med_paid_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct paid_date) > 1\n)\n\n, dispensing_date as (\nselect claim_id\nfrom tuva.claims_data_model.pharmacy_claim \ngroup by claim_id\nhaving count(distinct dispensing_date) > 1\n)\n\n, rx_paid_date as (\nselect claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\nhaving count(distinct paid_date) > 1\n)\n\n, combine as (\nselect \n 'claim_start_date' as date_type\n, count(1) as cnt\nfrom claim_start\n\nunion all\n\nselect \n 'claim_end_date' as date_type\n, count(1) as cnt\nfrom claim_end\n\nunion all\n\nselect \n 'admission_date' as date_type\n, count(1) as cnt\nfrom admission_date\n\nunion all\n\nselect \n 'discharge_date' as date_type\n, count(1) as cnt\nfrom discharge_date\n\nunion all\n\nselect \n 'med_paid_date' as date_type\n, count(1) as cnt\nfrom med_paid_date\n\nunion all\n\nselect \n 'dispensing_date' as date_type\n, count(1) as cnt\nfrom dispensing_date\n\nunion all\n\nselect \n 'rx_paid_date' as date_type\n, count(1) as cnt\nfrom rx_paid_date\n)\n\nselect\n \n \n sum(\n \n case\n when date_type = 'claim_start_date'\n then cnt\n else 0\n end\n )\n \n \n as claim_start_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'claim_end_date'\n then cnt\n else 0\n end\n )\n \n \n as claim_end_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'admission_date'\n then cnt\n else 0\n end\n )\n \n \n as admission_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'discharge_date'\n then cnt\n else 0\n end\n )\n \n \n as discharge_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'med_paid_date'\n then cnt\n else 0\n end\n )\n \n \n as med_paid_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'dispensing_date'\n then cnt\n else 0\n end\n )\n \n \n as dispensing_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'rx_paid_date'\n then cnt\n else 0\n end\n )\n \n \n as rx_paid_date\n \n \n \n \n\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom combine\norder by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__medical_claim_dates": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__medical_claim_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__medical_claim_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "intermediate", "claims_date_profiling__medical_claim_dates"], "alias": "_int_medical_claim_dates", "checksum": {"name": "sha256", "checksum": "93b8e1f2ff8befb1d2c9ce0b6c950c341cb3ebb9ed0e49610743f1b916d5542e"}, "config": {"enabled": true, "alias": "_int_medical_claim_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_dates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7772825, "relation_name": "tuva.claims_preprocessing._int_medical_claim_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith med_claims as (\r\nselect\r\n min(claim_start_date) as claim_start_date\r\n, min(claim_end_date) as claim_end_date\r\n, min(admission_date) as admission_date\r\n, min(discharge_date) as discharge_date\r\n, min(paid_date) as paid_date\r\n, claim_id\r\nfrom {{ ref('medical_claim') }} \r\ngroup by claim_id\r\n)\r\n\r\n, transform as (\r\nselect\r\n cast({{ date_part(\"year\",\"claim_start_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"claim_start_date\") }} as {{ dbt.type_string() }} ),2,'0') as claim_start_date\r\n, cast({{ date_part(\"year\",\"claim_end_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"claim_end_date\") }} as {{ dbt.type_string() }} ),2,'0') as claim_end_date\r\n, cast({{ date_part(\"year\",\"admission_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"admission_date\") }} as {{ dbt.type_string() }} ),2,'0') as admission_date\r\n, cast({{ date_part(\"year\",\"discharge_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"discharge_date\") }} as {{ dbt.type_string() }} ),2,'0') as discharge_date\r\n, cast({{ date_part(\"year\",\"paid_date\") }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\",\"paid_date\") }} as {{ dbt.type_string() }} ),2,'0') as paid_date\r\n, claim_id\r\nfrom med_claims\r\n)\r\n\r\n, pivot_prep as (\r\nselect\r\n cast(claim_start_date as {{ dbt.type_string() }} ) as year_month\r\n, 'claim_start_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(claim_end_date as {{ dbt.type_string() }} ) as year_month\r\n, 'claim_end_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(admission_date as {{ dbt.type_string() }} ) as year_month\r\n, 'admission_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(discharge_date as {{ dbt.type_string() }} ) as year_month\r\n, 'discharge_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n cast(paid_date as {{ dbt.type_string() }} ) as year_month\r\n, 'paid_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom transform \r\ngroup by 1,2\r\n)\r\n\r\nselect \r\nyear_month\r\n, {{ dbt_utils.pivot(\r\n column='date_type'\r\n , values=['claim_start_date','claim_end_date','admission_date','discharge_date','paid_date']\r\n , agg='sum'\r\n , quote_identifiers=false\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_prep\r\ngroup by year_month", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt_utils.pivot"], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__medical_claim_dates.sql", "compiled": true, "compiled_code": "\n\nwith med_claims as (\nselect\n min(claim_start_date) as claim_start_date\n, min(claim_end_date) as claim_end_date\n, min(admission_date) as admission_date\n, min(discharge_date) as discharge_date\n, min(paid_date) as paid_date\n, claim_id\nfrom tuva.claims_data_model.medical_claim \ngroup by claim_id\n)\n\n, transform as (\nselect\n cast(date_part('year', claim_start_date) as TEXT ) || lpad(cast(date_part('month', claim_start_date) as TEXT ),2,'0') as claim_start_date\n, cast(date_part('year', claim_end_date) as TEXT ) || lpad(cast(date_part('month', claim_end_date) as TEXT ),2,'0') as claim_end_date\n, cast(date_part('year', admission_date) as TEXT ) || lpad(cast(date_part('month', admission_date) as TEXT ),2,'0') as admission_date\n, cast(date_part('year', discharge_date) as TEXT ) || lpad(cast(date_part('month', discharge_date) as TEXT ),2,'0') as discharge_date\n, cast(date_part('year', paid_date) as TEXT ) || lpad(cast(date_part('month', paid_date) as TEXT ),2,'0') as paid_date\n, claim_id\nfrom med_claims\n)\n\n, pivot_prep as (\nselect\n cast(claim_start_date as TEXT ) as year_month\n, 'claim_start_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(claim_end_date as TEXT ) as year_month\n, 'claim_end_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(admission_date as TEXT ) as year_month\n, 'admission_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(discharge_date as TEXT ) as year_month\n, 'discharge_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n\nunion all\n\nselect\n cast(paid_date as TEXT ) as year_month\n, 'paid_date' as date_type\n, count(distinct claim_id) as cnt\nfrom transform \ngroup by 1,2\n)\n\nselect \nyear_month\n, \n \n sum(\n \n case\n when date_type = 'claim_start_date'\n then 1\n else 0\n end\n )\n \n \n as claim_start_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'claim_end_date'\n then 1\n else 0\n end\n )\n \n \n as claim_end_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'admission_date'\n then 1\n else 0\n end\n )\n \n \n as admission_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'discharge_date'\n then 1\n else 0\n end\n )\n \n \n as discharge_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'paid_date'\n then 1\n else 0\n end\n )\n \n \n as paid_date\n \n \n \n \n\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": {"database": "tuva", "schema": "claims_preprocessing", "name": "claims_date_profiling__pharmacy_claim_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "unique_id": "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "date_profiling", "intermediate", "claims_date_profiling__pharmacy_claim_dates"], "alias": "_int_pharmacy_claim_dates", "checksum": {"name": "sha256", "checksum": "5ad18dd582812868c8a1c76b409a22de9523cc52a7621b7c190a7ed219a17550"}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_dates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7812724, "relation_name": "tuva.claims_preprocessing._int_pharmacy_claim_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith rx_claims as (\r\nselect\r\n min(dispensing_date) as dispensing_date\r\n, min(paid_date) as paid_date\r\n, claim_id\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by claim_id\r\n)\r\n\r\n, rx_transform as (\r\nselect\r\n cast({{ date_part(\"year\",\"dispensing_date\") }} as {{ dbt.type_string() }} ) || lpad( cast( {{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }} ) ,2,'0') as dispensing_date\r\n, cast({{ date_part(\"year\",\"paid_date\") }} as {{ dbt.type_string() }} ) || lpad( cast( {{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }} ) ,2,'0') as paid_date\r\n, claim_id\r\nfrom rx_claims\r\n)\r\n\r\n, rx_pivot_prep as (\r\nselect\r\n dispensing_date as year_month\r\n, 'dispensing_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom rx_transform \r\ngroup by 1,2\r\n\r\nunion all\r\n\r\nselect\r\n paid_date as year_month\r\n, 'paid_date' as date_type\r\n, count(distinct claim_id) as cnt\r\nfrom rx_transform \r\ngroup by 1,2\r\n)\r\n\r\nselect\r\nyear_month\r\n, {{ dbt_utils.pivot(\r\n column='date_type'\r\n , values=['dispensing_date','paid_date']\r\n , agg='sum'\r\n , quote_identifiers=false\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom rx_pivot_prep\r\ngroup by year_month", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt_utils.pivot"], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\date_profiling\\intermediate\\claims_date_profiling__pharmacy_claim_dates.sql", "compiled": true, "compiled_code": "\n\nwith rx_claims as (\nselect\n min(dispensing_date) as dispensing_date\n, min(paid_date) as paid_date\n, claim_id\nfrom tuva.claims_data_model.pharmacy_claim \ngroup by claim_id\n)\n\n, rx_transform as (\nselect\n cast(date_part('year', dispensing_date) as TEXT ) || lpad( cast( date_part('month', dispensing_date) as TEXT ) ,2,'0') as dispensing_date\n, cast(date_part('year', paid_date) as TEXT ) || lpad( cast( date_part('month', paid_date) as TEXT ) ,2,'0') as paid_date\n, claim_id\nfrom rx_claims\n)\n\n, rx_pivot_prep as (\nselect\n dispensing_date as year_month\n, 'dispensing_date' as date_type\n, count(distinct claim_id) as cnt\nfrom rx_transform \ngroup by 1,2\n\nunion all\n\nselect\n paid_date as year_month\n, 'paid_date' as date_type\n, count(distinct claim_id) as cnt\nfrom rx_transform \ngroup by 1,2\n)\n\nselect\nyear_month\n, \n \n sum(\n \n case\n when date_type = 'dispensing_date'\n then 1\n else 0\n end\n )\n \n \n as dispensing_date\n \n \n ,\n \n sum(\n \n case\n when date_type = 'paid_date'\n then 1\n else 0\n end\n )\n \n \n as paid_date\n \n \n \n \n\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom rx_pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__summary": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__summary.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__summary.sql", "unique_id": "model.the_tuva_project.data_profiling__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "5c618cfae1045c519ea0f22fcd0490f1665c15241fd5ea5b9a22f15cf17a6a42"}, "config": {"enabled": true, "alias": "summary", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test category is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed", "meta": {}, "data_type": "integer", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "summary", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7606773, "relation_name": "tuva.claims_preprocessing.summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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) as int) as counts\r\n from {{ ref('data_profiling__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('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_profiling__medical_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__claim_type_mapping_failures' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__claim_type_unmapped' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_inst_missing_values' )}} where test_category = 'claim_type')\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} where test_category = 'claim_type')\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__institutional_header_fail_details' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__professional_header_fail_details' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__medical_claim_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__medical_claim_inst_missing_values' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} )\r\n\r\n /**** eligibility ****/\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__eligibility_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__eligibility_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__eligibility_missing_values' )}} )\r\n\r\n /**** pharmacy_claim ****/\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__pharmacy_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('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_profiling__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 = 'medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'medical_claim' and test_category = 'good'\r\n then '7_good' \r\n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'eligibility' and test_category = 'plausibility'\r\n then '4_plausibility' \r\n when source_table = 'eligibility' and test_category = 'good'\r\n then '5_good'\r\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility' \r\n when source_table = '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": [["data_profiling__test_detail"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__claim_type_unmapped"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_missing_values"], ["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__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) as int) as counts\n from tuva.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('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 tuva.claims_preprocessing._int_medical_claim_duplicates )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_claim_type_mapping_failures )\n and not exists (select 1 from tuva.claims_preprocessing._int_claim_type_unmapped )\n and not exists (select 1 from tuva.claims_preprocessing._int_medical_claim_inst_missing_values where test_category = 'claim_type')\n and not exists (select 1 from tuva.claims_preprocessing._int_medical_claim_prof_missing_values where test_category = 'claim_type')\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_institutional_header_fail_details )\n and not exists (select 1 from tuva.claims_preprocessing._int_professional_header_fail_details )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_medical_claim_invalid_values )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_medical_claim_inst_missing_values )\n and not exists (select 1 from tuva.claims_preprocessing._int_medical_claim_prof_missing_values )\n\n /**** eligibility ****/\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_eligibility_duplicates )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_eligibility_invalid_values )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_eligibility_missing_values )\n\n /**** pharmacy_claim ****/\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_pharmacy_claim_duplicates )\n union all\n select * from (\n select\n cast('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 tuva.claims_preprocessing._int_pharmacy_claim_missing_values )\n)\n\nselect \n cast(source_table as TEXT ) as source_table\n , cast(case \n when source_table = 'medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'medical_claim' and test_category = 'good'\n then '7_good' \n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'eligibility' and test_category = 'plausibility'\n then '4_plausibility' \n when source_table = 'eligibility' and test_category = 'good'\n then '5_good'\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = 'pharmacy_claim' and test_category = 'plausibility'\n then '3_plausibility' \n when source_table = '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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_detail"], "alias": "test_detail", "checksum": {"name": "sha256", "checksum": "4f1779e900d970e05e21590d0a176554467de8011acdeb88af35a19a885844f0"}, "config": {"enabled": true, "alias": "test_detail", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_detail", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7652323, "relation_name": "tuva.claims_preprocessing.test_detail", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith test_detail_union as(\r\n\r\nselect * from {{ ref('data_profiling__test_detail_stage_medical_claim') }}\r\nunion all\r\nselect * from {{ ref('data_profiling__test_detail_stage_eligibility') }}\r\nunion all\r\nselect * from {{ ref('data_profiling__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 = 'medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'eligibility' and test_category = 'plausibility'\r\n then '4_plausibility'\r\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = '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 , claim_id as foreign_key\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom test_detail_union", "language": "sql", "refs": [["data_profiling__test_detail_stage_medical_claim"], ["data_profiling__test_detail_stage_eligibility"], ["data_profiling__test_detail_stage_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "compiled": true, "compiled_code": "\n\nwith test_detail_union as(\n\nselect * from tuva.claims_preprocessing._int_test_detail_stage_medical_claim\nunion all\nselect * from tuva.claims_preprocessing._int_test_detail_stage_eligibility\nunion all\nselect * from tuva.claims_preprocessing._int_test_detail_stage_pharmacy_claim\n\n\n)\n\nselect \n source_table\n , case \n when source_table = 'medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'eligibility' and test_category = 'plausibility'\n then '4_plausibility'\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = '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 , claim_id as foreign_key\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_result"], "alias": "test_result", "checksum": {"name": "sha256", "checksum": "e3e47acca220ab867995a28e451c6637feb732a6e7d27972703bfef69c144bc2"}, "config": {"enabled": true, "alias": "test_result", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_result", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7707276, "relation_name": "tuva.claims_preprocessing.test_result", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_eligibility') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_pharmacy_claim') }}", "language": "sql", "refs": [["data_profiling__test_result_stage_medical_claim"], ["data_profiling__test_result_stage_eligibility"], ["data_profiling__test_result_stage_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.claims_preprocessing._int_test_result_stage_medical_claim\n\nunion all\n\nselect * from tuva.claims_preprocessing._int_test_result_stage_eligibility\n\nunion all\n\nselect * from tuva.claims_preprocessing._int_test_result_stage_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__use_case": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__use_case", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__use_case.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__use_case.sql", "unique_id": "model.the_tuva_project.data_profiling__use_case", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__use_case"], "alias": "use_case", "checksum": {"name": "sha256", "checksum": "1d8c2a667917a846a9b1780b0345d8da36b9da9a2d63d37e8a17fe1246ce5d63"}, "config": {"enabled": true, "alias": "use_case", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {"use_case": {"name": "use_case", "description": "The mart or logic that would be affected by test failures", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "use_case", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.774714, "relation_name": "tuva.claims_preprocessing.use_case", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }}) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct patient_id) from {{ ref('eligibility') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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) as failures\r\n , (select count(distinct claim_id) from {{ ref('pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_profiling__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 = '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": [["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"], ["eligibility"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.eligibility", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.pharmacy_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct patient_id) from tuva.claims_data_model.eligibility ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.medical_claim ) as denominator\n from tuva.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 = '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) as failures\n , (select count(distinct claim_id) from tuva.claims_data_model.pharmacy_claim ) as denominator\n from tuva.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 = 'pharmacy_claim'\n group by\n source_table\n , test_name\n)\n\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__claim_type_mapping_failures": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__claim_type_mapping_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "unique_id": "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__claim_type_mapping_failures"], "alias": "_int_claim_type_mapping_failures", "checksum": {"name": "sha256", "checksum": "3d19c09bd9c3bdca878144171bd0c52eafa8b7db6b242e2d420ddab45b21088b"}, "config": {"enabled": true, "alias": "_int_claim_type_mapping_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_mapping_failures", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7113354, "relation_name": "tuva.claims_preprocessing._int_claim_type_mapping_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_type_mapping as(\r\n select \r\n claim_id\r\n , claim_line_number\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('medical_claim') }} \r\n )\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'claim_type' as test_category\r\n , 'claim_type mapping incorrect' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_type_mapping\r\nwhere source_claim_type <> data_profiling_claim_type\r\ngroup by\r\n claim_id", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_mapping_failures.sql", "compiled": true, "compiled_code": "\n\nwith claim_type_mapping as(\n select \n claim_id\n , claim_line_number\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 tuva.claims_data_model.medical_claim \n )\n\nselect\n 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'claim_type' as test_category\n , 'claim_type mapping incorrect' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom claim_type_mapping\nwhere source_claim_type <> data_profiling_claim_type\ngroup by\n claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__claim_type_unmapped", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "unique_id": "model.the_tuva_project.data_profiling__claim_type_unmapped", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__claim_type_unmapped"], "alias": "_int_claim_type_unmapped", "checksum": {"name": "sha256", "checksum": "568b4dd3e023834e99f28d9322721d93cd2ddc70a1de05c3684303d33b025968"}, "config": {"enabled": true, "alias": "_int_claim_type_unmapped", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_unmapped", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.6893208, "relation_name": "tuva.claims_preprocessing._int_claim_type_unmapped", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'claim_type' as test_category\r\n , 'claim_type missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere claim_type is null\r\ngroup by\r\n claim_id", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__claim_type_unmapped.sql", "compiled": true, "compiled_code": "\n\nselect\n 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'claim_type' as test_category\n , 'claim_type missing' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \nwhere claim_type is null\ngroup by\n claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_denominators": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_denominators", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_denominators"], "alias": "_int_eligibility_denominators", "checksum": {"name": "sha256", "checksum": "31ab3c529e96e3ac469dffef9da2b497a7dfcd38075bd032847e302145e98688"}, "config": {"enabled": true, "alias": "_int_eligibility_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_denominators", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.739986, "relation_name": "tuva.claims_preprocessing._int_eligibility_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith all_denominator as(\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('eligibility') }}\r\n)\r\n, gender_denominator as(\r\n select\r\n cast('gender invalid' 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('eligibility') }}\r\n where gender is not null\r\n)\r\n, race_denominator as(\r\n select\r\n cast('race invalid' 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('eligibility') }}\r\n where race is not null\r\n)\r\n, payer_type_denominator as(\r\n select\r\n cast('payer_type invalid' 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('eligibility') }}\r\n where payer_type is not null\r\n)\r\n, dual_status_denominator as(\r\n select\r\n cast('dual_status_code invalid' 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('eligibility') }}\r\n where dual_status_code is not null\r\n)\r\n, medicare_status_denominator as(\r\n select\r\n cast('medicare_status_code invalid' 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('eligibility') }}\r\n where medicare_status_code is not null\r\n)\r\nselect * from all_denominator\r\nunion all\r\nselect * from gender_denominator\r\nunion all \r\nselect * from race_denominator\r\nunion all \r\nselect * from payer_type_denominator\r\nunion all \r\nselect * from dual_status_denominator\r\nunion all \r\nselect * from medicare_status_denominator", "language": "sql", "refs": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_denominators.sql", "compiled": true, "compiled_code": "\n\nwith all_denominator as(\n select\n cast('all' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n)\n, gender_denominator as(\n select\n cast('gender invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where gender is not null\n)\n, race_denominator as(\n select\n cast('race invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where race is not null\n)\n, payer_type_denominator as(\n select\n cast('payer_type invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where payer_type is not null\n)\n, dual_status_denominator as(\n select\n cast('dual_status_code invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where dual_status_code is not null\n)\n, medicare_status_denominator as(\n select\n cast('medicare_status_code invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where medicare_status_code is not null\n)\nselect * from all_denominator\nunion all\nselect * from gender_denominator\nunion all \nselect * from race_denominator\nunion all \nselect * from payer_type_denominator\nunion all \nselect * from dual_status_denominator\nunion all \nselect * from medicare_status_denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_duplicates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_duplicates"], "alias": "_int_eligibility_duplicates", "checksum": {"name": "sha256", "checksum": "939ace4215eac13b6fd9cd27ff3a10a6b37cbec84cbdf84873bea62837992420"}, "config": {"enabled": true, "alias": "_int_eligibility_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_duplicates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.727909, "relation_name": "tuva.claims_preprocessing._int_eligibility_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate eligibility' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }} \r\ngroup by\r\n patient_id\r\n , member_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\nhaving count(*) > 1", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_duplicates.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n 'eligibility' as source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , patient_id \n , 'duplicate_values' as test_category\n , 'duplicate eligibility' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility \ngroup by\n patient_id\n , member_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_invalid_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_invalid_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_invalid_values"], "alias": "_int_eligibility_invalid_values", "checksum": {"name": "sha256", "checksum": "a539dff7e28701b0ee64df658b6eeff52258ae09b2af04a35effb41690ba44b7"}, "config": {"enabled": true, "alias": "_int_eligibility_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_invalid_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7313387, "relation_name": "tuva.claims_preprocessing._int_eligibility_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith valid_gender as(\r\n select\r\n 'gender invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.gender\r\n , count(elig.gender) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__gender') }} gender\r\n on elig.gender = gender.gender\r\n where gender.gender is null\r\n and elig.gender is not null\r\n group by\r\n patient_id\r\n , elig.gender\r\n)\r\n, valid_race as(\r\n select\r\n 'race invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.race\r\n , count(elig.race) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__race') }} race\r\n on elig.race = race.description\r\n where race.description is null\r\n and elig.race is not null\r\n group by\r\n patient_id\r\n , elig.race\r\n)\r\n, valid_payer_type as(\r\n select\r\n 'payer_type invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.payer_type\r\n , count(elig.payer_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__payer_type') }} payer\r\n on elig.payer_type = payer.payer_type\r\n where payer.payer_type is null\r\n and elig.payer_type is not null\r\n group by\r\n patient_id\r\n , elig.payer_type\r\n)\r\n, valid_dual_status_code as(\r\n select\r\n 'dual_status_code invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.dual_status_code\r\n , count(elig.dual_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__medicare_dual_eligibility') }} dual\r\n on elig.dual_status_code = dual.dual_status_code\r\n where dual.dual_status_code is null\r\n and elig.dual_status_code is not null\r\n group by\r\n patient_id\r\n , elig.dual_status_code\r\n)\r\n, valid_medicare_status_code as(\r\n select\r\n 'medicare_status_code invalid' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , elig.medicare_status_code\r\n , count(elig.medicare_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} elig\r\n left join {{ ref('terminology__medicare_status') }} status\r\n on elig.medicare_status_code = status.medicare_status_code\r\n where status.medicare_status_code is null\r\n and elig.medicare_status_code is not null\r\n group by\r\n patient_id\r\n , elig.medicare_status_code\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_dual_status_code\r\nunion all\r\nselect * from valid_medicare_status_code", "language": "sql", "refs": [["eligibility"], ["terminology__gender"], ["eligibility"], ["terminology__race"], ["eligibility"], ["terminology__payer_type"], ["eligibility"], ["terminology__medicare_dual_eligibility"], ["eligibility"], ["terminology__medicare_status"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__gender", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__race", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__payer_type", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__medicare_status"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith valid_gender as(\n select\n 'gender invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.gender\n , count(elig.gender) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.gender gender\n on elig.gender = gender.gender\n where gender.gender is null\n and elig.gender is not null\n group by\n patient_id\n , elig.gender\n)\n, valid_race as(\n select\n 'race invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.race\n , count(elig.race) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.race race\n on elig.race = race.description\n where race.description is null\n and elig.race is not null\n group by\n patient_id\n , elig.race\n)\n, valid_payer_type as(\n select\n 'payer_type invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.payer_type\n , count(elig.payer_type) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.payer_type payer\n on elig.payer_type = payer.payer_type\n where payer.payer_type is null\n and elig.payer_type is not null\n group by\n patient_id\n , elig.payer_type\n)\n, valid_dual_status_code as(\n select\n 'dual_status_code invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.dual_status_code\n , count(elig.dual_status_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.medicare_dual_eligibility dual\n on elig.dual_status_code = dual.dual_status_code\n where dual.dual_status_code is null\n and elig.dual_status_code is not null\n group by\n patient_id\n , elig.dual_status_code\n)\n, valid_medicare_status_code as(\n select\n 'medicare_status_code invalid' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'patient_id' as grain\n , patient_id\n , elig.medicare_status_code\n , count(elig.medicare_status_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility elig\n left join tuva.terminology.medicare_status status\n on elig.medicare_status_code = status.medicare_status_code\n where status.medicare_status_code is null\n and elig.medicare_status_code is not null\n group by\n patient_id\n , elig.medicare_status_code\n)\nselect * from valid_gender\nunion all\nselect * from valid_race\nunion all\nselect * from valid_payer_type\nunion all\nselect * from valid_dual_status_code\nunion all\nselect * from valid_medicare_status_code", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_missing_values"], "alias": "_int_eligibility_missing_values", "checksum": {"name": "sha256", "checksum": "67cf90c8c09eee508dd7724b5744f1169d200c487d429544906e46b4919303aa"}, "config": {"enabled": true, "alias": "_int_eligibility_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7343285, "relation_name": "tuva.claims_preprocessing._int_eligibility_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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\n\r\n\r\nwith eligibility_missing as(\r\n\r\n {{ eligibility_missing_column_check(builtins.ref('eligibility'), eligibility_missing_column_list) }}\r\n\r\n)\r\n\r\n\r\nselect\r\n 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\ngroup by\r\n patient_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.eligibility_missing_column_check"], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith eligibility_missing as(\n\n \n select\n patient_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.eligibility\n where patient_id is null\n union all\n select\n patient_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.eligibility\n where member_id is null\n union all\n select\n patient_id\n , 'gender' as column_checked\n from tuva.claims_data_model.eligibility\n where gender is null\n union all\n select\n patient_id\n , 'race' as column_checked\n from tuva.claims_data_model.eligibility\n where race is null\n union all\n select\n patient_id\n , 'birth_date' as column_checked\n from tuva.claims_data_model.eligibility\n where birth_date is null\n union all\n select\n patient_id\n , 'death_date' as column_checked\n from tuva.claims_data_model.eligibility\n where death_date is null\n union all\n select\n patient_id\n , 'death_flag' as column_checked\n from tuva.claims_data_model.eligibility\n where death_flag is null\n union all\n select\n patient_id\n , 'enrollment_start_date' as column_checked\n from tuva.claims_data_model.eligibility\n where enrollment_start_date is null\n union all\n select\n patient_id\n , 'enrollment_end_date' as column_checked\n from tuva.claims_data_model.eligibility\n where enrollment_end_date is null\n union all\n select\n patient_id\n , 'payer' as column_checked\n from tuva.claims_data_model.eligibility\n where payer is null\n union all\n select\n patient_id\n , 'payer_type' as column_checked\n from tuva.claims_data_model.eligibility\n where payer_type is null\n union all\n select\n patient_id\n , 'dual_status_code' as column_checked\n from tuva.claims_data_model.eligibility\n where dual_status_code is null\n union all\n select\n patient_id\n , 'medicare_status_code' as column_checked\n from tuva.claims_data_model.eligibility\n where medicare_status_code is null\n union all\n select\n patient_id\n , 'first_name' as column_checked\n from tuva.claims_data_model.eligibility\n where first_name is null\n union all\n select\n patient_id\n , 'last_name' as column_checked\n from tuva.claims_data_model.eligibility\n where last_name is null\n union all\n select\n patient_id\n , 'address' as column_checked\n from tuva.claims_data_model.eligibility\n where address is null\n union all\n select\n patient_id\n , 'city' as column_checked\n from tuva.claims_data_model.eligibility\n where city is null\n union all\n select\n patient_id\n , 'state' as column_checked\n from tuva.claims_data_model.eligibility\n where state is null\n union all\n select\n patient_id\n , 'zip_code' as column_checked\n from tuva.claims_data_model.eligibility\n where zip_code is null\n union all\n select\n patient_id\n , 'phone' as column_checked\n from tuva.claims_data_model.eligibility\n where phone is null\n union all\n select\n patient_id\n , 'data_source' as column_checked\n from tuva.claims_data_model.eligibility\n where data_source is null\n \n\n)\n\n\nselect\n 'eligibility' as source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , patient_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n patient_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_plausibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__eligibility_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "unique_id": "model.the_tuva_project.data_profiling__eligibility_plausibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_plausibility"], "alias": "_int_eligibility_plausibility", "checksum": {"name": "sha256", "checksum": "dfe1e7b7daade6b60b640a74dc25ccd67f9d42d1e85816eb09b5208f50998046"}, "config": {"enabled": true, "alias": "_int_eligibility_plausibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_plausibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7419562, "relation_name": "tuva.claims_preprocessing._int_eligibility_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith multiple_genders_test as (\r\n select\r\n 'multiple genders' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct gender) > 1\r\n)\r\n, multiple_races_test as(\r\n select\r\n 'multiple races' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} \r\n group by\r\n patient_id\r\n having count(distinct race) > 1\r\n)\r\n, multiple_birth_dates_test as(\r\n select\r\n 'multiple birth dates' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct birth_date) > 1\r\n)\r\n, multiple_death_dates_test as(\r\n select\r\n 'multiple death dates' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct death_date) > 1\r\n)\r\n, birth_date_after_death_date as(\r\n select\r\n 'birth date after death date' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n where birth_date > death_date\r\n group by\r\n patient_id\r\n having count(distinct gender) > 1\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": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__eligibility_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith multiple_genders_test as (\n select\n 'multiple genders' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n group by\n patient_id\n having count(distinct gender) > 1\n)\n, multiple_races_test as(\n select\n 'multiple races' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility \n group by\n patient_id\n having count(distinct race) > 1\n)\n, multiple_birth_dates_test as(\n select\n 'multiple birth dates' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n group by\n patient_id\n having count(distinct birth_date) > 1\n)\n, multiple_death_dates_test as(\n select\n 'multiple death dates' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n group by\n patient_id\n having count(distinct death_date) > 1\n)\n, birth_date_after_death_date as(\n select\n 'birth date after death date' as test_name\n , 'eligibility' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'patient_id' as grain\n , patient_id\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.eligibility\n where birth_date > death_date\n group by\n patient_id\n having count(distinct gender) > 1\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": []}, "model.the_tuva_project.data_profiling__institutional_header_failures": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__institutional_header_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "unique_id": "model.the_tuva_project.data_profiling__institutional_header_failures", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_failures"], "alias": "_int_institutional_header_failures", "checksum": {"name": "sha256", "checksum": "5e058b75ff1a328677ee6f83936fec20d76a2eb29f2b39eee11bd3036b0fb18a"}, "config": {"enabled": true, "alias": "_int_institutional_header_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_failures", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.6913784, "relation_name": "tuva.claims_preprocessing._int_institutional_header_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith stage as(\r\n select distinct\r\n claim_id\r\n , claim_type\r\n , patient_id\r\n , member_id\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 from {{ ref('medical_claim') }} \r\n where claim_type = 'institutional'\r\n ) \r\n, claims_with_duplicates as (\r\nselect \r\n claim_id\r\n , 1 as invalid_header\r\nfrom stage\r\ngroup by claim_id\r\nhaving count(*) > 1\r\n)\r\n\r\nselect med.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\r\ninner join {{ ref('medical_claim') }} med\r\n on dupe.claim_id = med.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_failures.sql", "compiled": true, "compiled_code": "\n\nwith stage as(\n select distinct\n claim_id\n , claim_type\n , patient_id\n , member_id\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , bill_type_code\n , ms_drg_code\n , facility_npi\n , billing_npi\n , rendering_npi\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 from tuva.claims_data_model.medical_claim \n where claim_type = 'institutional'\n ) \n, claims_with_duplicates as (\nselect \n claim_id\n , 1 as invalid_header\nfrom stage\ngroup by claim_id\nhaving count(*) > 1\n)\n\nselect med.*, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run from claims_with_duplicates dupe\ninner join tuva.claims_data_model.medical_claim med\n on dupe.claim_id = med.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__institutional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_fail_details"], "alias": "_int_institutional_header_fail_details", "checksum": {"name": "sha256", "checksum": "2438594d9d3c5c5d9d277e44bf079790c55a44c0f55e560e9c851002224a9b50"}, "config": {"enabled": true, "alias": "_int_institutional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_fail_details", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.6981816, "relation_name": "tuva.claims_preprocessing._int_institutional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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 {{ header_duplicate_check(builtins.ref('data_profiling__institutional_header_failures'), institutional_header_column_list, 'institutional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , 'header' as test_category\r\n , column_checked||' duplicated' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_header_duplicates\r\ngroup by \r\n claim_id\r\n , column_checked||' duplicated'", "language": "sql", "refs": [["data_profiling__institutional_header_failures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_failures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith institutional_header_duplicates as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , 'admission_date' as column_checked\n , count(distinct admission_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct admission_date) > 1\n union all\n select\n claim_id\n , 'discharge_date' as column_checked\n , count(distinct discharge_date) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct discharge_date) > 1\n union all\n select\n claim_id\n , 'admit_source_code' as column_checked\n , count(distinct admit_source_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct admit_source_code) > 1\n union all\n select\n claim_id\n , 'admit_type_code' as column_checked\n , count(distinct admit_type_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct admit_type_code) > 1\n union all\n select\n claim_id\n , 'discharge_disposition_code' as column_checked\n , count(distinct discharge_disposition_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct discharge_disposition_code) > 1\n union all\n select\n claim_id\n , 'bill_type_code' as column_checked\n , count(distinct bill_type_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct bill_type_code) > 1\n union all\n select\n claim_id\n , 'ms_drg_code' as column_checked\n , count(distinct ms_drg_code) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct ms_drg_code) > 1\n union all\n select\n claim_id\n , 'facility_npi' as column_checked\n , count(distinct facility_npi) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct facility_npi) > 1\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , 'rendering_npi' as column_checked\n , count(distinct rendering_npi) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct rendering_npi) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_1' as column_checked\n , count(distinct diagnosis_poa_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_1) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_2' as column_checked\n , count(distinct diagnosis_poa_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_2) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_3' as column_checked\n , count(distinct diagnosis_poa_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_3) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_4' as column_checked\n , count(distinct diagnosis_poa_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_4) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_5' as column_checked\n , count(distinct diagnosis_poa_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_5) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_6' as column_checked\n , count(distinct diagnosis_poa_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_6) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_7' as column_checked\n , count(distinct diagnosis_poa_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_7) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_8' as column_checked\n , count(distinct diagnosis_poa_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_8) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_9' as column_checked\n , count(distinct diagnosis_poa_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_9) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_10' as column_checked\n , count(distinct diagnosis_poa_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_10) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_11' as column_checked\n , count(distinct diagnosis_poa_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_11) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_12' as column_checked\n , count(distinct diagnosis_poa_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_12) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_13' as column_checked\n , count(distinct diagnosis_poa_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_13) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_14' as column_checked\n , count(distinct diagnosis_poa_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_14) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_15' as column_checked\n , count(distinct diagnosis_poa_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_15) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_16' as column_checked\n , count(distinct diagnosis_poa_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_16) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_17' as column_checked\n , count(distinct diagnosis_poa_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_17) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_18' as column_checked\n , count(distinct diagnosis_poa_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_18) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_19' as column_checked\n , count(distinct diagnosis_poa_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_19) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_20' as column_checked\n , count(distinct diagnosis_poa_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_20) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_21' as column_checked\n , count(distinct diagnosis_poa_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_21) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_22' as column_checked\n , count(distinct diagnosis_poa_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_22) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_23' as column_checked\n , count(distinct diagnosis_poa_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_23) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_24' as column_checked\n , count(distinct diagnosis_poa_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_24) > 1\n union all\n select\n claim_id\n , 'diagnosis_poa_25' as column_checked\n , count(distinct diagnosis_poa_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct diagnosis_poa_25) > 1\n union all\n select\n claim_id\n , 'procedure_code_type' as column_checked\n , count(distinct procedure_code_type) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_type) > 1\n union all\n select\n claim_id\n , 'procedure_code_1' as column_checked\n , count(distinct procedure_code_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_1) > 1\n union all\n select\n claim_id\n , 'procedure_code_2' as column_checked\n , count(distinct procedure_code_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_2) > 1\n union all\n select\n claim_id\n , 'procedure_code_3' as column_checked\n , count(distinct procedure_code_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_3) > 1\n union all\n select\n claim_id\n , 'procedure_code_4' as column_checked\n , count(distinct procedure_code_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_4) > 1\n union all\n select\n claim_id\n , 'procedure_code_5' as column_checked\n , count(distinct procedure_code_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_5) > 1\n union all\n select\n claim_id\n , 'procedure_code_6' as column_checked\n , count(distinct procedure_code_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_6) > 1\n union all\n select\n claim_id\n , 'procedure_code_7' as column_checked\n , count(distinct procedure_code_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_7) > 1\n union all\n select\n claim_id\n , 'procedure_code_8' as column_checked\n , count(distinct procedure_code_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_8) > 1\n union all\n select\n claim_id\n , 'procedure_code_9' as column_checked\n , count(distinct procedure_code_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_9) > 1\n union all\n select\n claim_id\n , 'procedure_code_10' as column_checked\n , count(distinct procedure_code_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_10) > 1\n union all\n select\n claim_id\n , 'procedure_code_11' as column_checked\n , count(distinct procedure_code_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_11) > 1\n union all\n select\n claim_id\n , 'procedure_code_12' as column_checked\n , count(distinct procedure_code_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_12) > 1\n union all\n select\n claim_id\n , 'procedure_code_13' as column_checked\n , count(distinct procedure_code_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_13) > 1\n union all\n select\n claim_id\n , 'procedure_code_14' as column_checked\n , count(distinct procedure_code_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_14) > 1\n union all\n select\n claim_id\n , 'procedure_code_15' as column_checked\n , count(distinct procedure_code_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_15) > 1\n union all\n select\n claim_id\n , 'procedure_code_16' as column_checked\n , count(distinct procedure_code_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_16) > 1\n union all\n select\n claim_id\n , 'procedure_code_17' as column_checked\n , count(distinct procedure_code_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_17) > 1\n union all\n select\n claim_id\n , 'procedure_code_18' as column_checked\n , count(distinct procedure_code_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_18) > 1\n union all\n select\n claim_id\n , 'procedure_code_19' as column_checked\n , count(distinct procedure_code_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_19) > 1\n union all\n select\n claim_id\n , 'procedure_code_20' as column_checked\n , count(distinct procedure_code_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_20) > 1\n union all\n select\n claim_id\n , 'procedure_code_21' as column_checked\n , count(distinct procedure_code_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_21) > 1\n union all\n select\n claim_id\n , 'procedure_code_22' as column_checked\n , count(distinct procedure_code_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_22) > 1\n union all\n select\n claim_id\n , 'procedure_code_23' as column_checked\n , count(distinct procedure_code_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_23) > 1\n union all\n select\n claim_id\n , 'procedure_code_24' as column_checked\n , count(distinct procedure_code_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_24) > 1\n union all\n select\n claim_id\n , 'procedure_code_25' as column_checked\n , count(distinct procedure_code_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_code_25) > 1\n union all\n select\n claim_id\n , 'procedure_date_1' as column_checked\n , count(distinct procedure_date_1) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_1) > 1\n union all\n select\n claim_id\n , 'procedure_date_2' as column_checked\n , count(distinct procedure_date_2) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_2) > 1\n union all\n select\n claim_id\n , 'procedure_date_3' as column_checked\n , count(distinct procedure_date_3) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_3) > 1\n union all\n select\n claim_id\n , 'procedure_date_4' as column_checked\n , count(distinct procedure_date_4) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_4) > 1\n union all\n select\n claim_id\n , 'procedure_date_5' as column_checked\n , count(distinct procedure_date_5) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_5) > 1\n union all\n select\n claim_id\n , 'procedure_date_6' as column_checked\n , count(distinct procedure_date_6) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_6) > 1\n union all\n select\n claim_id\n , 'procedure_date_7' as column_checked\n , count(distinct procedure_date_7) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_7) > 1\n union all\n select\n claim_id\n , 'procedure_date_8' as column_checked\n , count(distinct procedure_date_8) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_8) > 1\n union all\n select\n claim_id\n , 'procedure_date_9' as column_checked\n , count(distinct procedure_date_9) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_9) > 1\n union all\n select\n claim_id\n , 'procedure_date_10' as column_checked\n , count(distinct procedure_date_10) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_10) > 1\n union all\n select\n claim_id\n , 'procedure_date_11' as column_checked\n , count(distinct procedure_date_11) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_11) > 1\n union all\n select\n claim_id\n , 'procedure_date_12' as column_checked\n , count(distinct procedure_date_12) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_12) > 1\n union all\n select\n claim_id\n , 'procedure_date_13' as column_checked\n , count(distinct procedure_date_13) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_13) > 1\n union all\n select\n claim_id\n , 'procedure_date_14' as column_checked\n , count(distinct procedure_date_14) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_14) > 1\n union all\n select\n claim_id\n , 'procedure_date_15' as column_checked\n , count(distinct procedure_date_15) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_15) > 1\n union all\n select\n claim_id\n , 'procedure_date_16' as column_checked\n , count(distinct procedure_date_16) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_16) > 1\n union all\n select\n claim_id\n , 'procedure_date_17' as column_checked\n , count(distinct procedure_date_17) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_17) > 1\n union all\n select\n claim_id\n , 'procedure_date_18' as column_checked\n , count(distinct procedure_date_18) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_18) > 1\n union all\n select\n claim_id\n , 'procedure_date_19' as column_checked\n , count(distinct procedure_date_19) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_19) > 1\n union all\n select\n claim_id\n , 'procedure_date_20' as column_checked\n , count(distinct procedure_date_20) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_20) > 1\n union all\n select\n claim_id\n , 'procedure_date_21' as column_checked\n , count(distinct procedure_date_21) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_21) > 1\n union all\n select\n claim_id\n , 'procedure_date_22' as column_checked\n , count(distinct procedure_date_22) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_22) > 1\n union all\n select\n claim_id\n , 'procedure_date_23' as column_checked\n , count(distinct procedure_date_23) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_23) > 1\n union all\n select\n claim_id\n , 'procedure_date_24' as column_checked\n , count(distinct procedure_date_24) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_24) > 1\n union all\n select\n claim_id\n , 'procedure_date_25' as column_checked\n , count(distinct procedure_date_25) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct procedure_date_25) > 1\n union all\n select\n claim_id\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from tuva.claims_preprocessing._int_institutional_header_failures\n where claim_type = 'institutional'\n group by claim_id\n having count(distinct data_source) > 1\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , claim_id\n , 'header' as test_category\n , column_checked||' duplicated' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom institutional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_denominators": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_denominators"], "alias": "_int_medical_claim_denominators", "checksum": {"name": "sha256", "checksum": "ca1857f87248fede22aa2d9babcf31d46a5cfb86bd7afe67c21b8826359f2bca"}, "config": {"enabled": true, "alias": "_int_medical_claim_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_denominators", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7198505, "relation_name": "tuva.claims_preprocessing._int_medical_claim_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith professional_denominator as(\r\n select \r\n cast('professional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , cast(count(distinct claim_id) as int) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'professional'\r\n)\r\n\r\n, institutional_denominator as(\r\n select \r\n cast('institutional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'institutional'\r\n)\r\n\r\n, all_claim_denominator as(\r\n select \r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type is not null\r\n)\r\n\r\n, bill_type_denominator as(\r\n select\r\n cast('bill_type_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where bill_type_code is not null\r\n)\r\n\r\n, revenue_center_denominator as(\r\n select\r\n cast('revenue_center_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where revenue_center_code is not null\r\n)\r\n\r\n, discharge_disposition_denominator as(\r\n select\r\n cast('discharge_disposition_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where discharge_disposition_code is not null\r\n)\r\n, admit_source_denominator as( \r\n select\r\n cast('admit_source_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where admit_source_code is not null\r\n)\r\n\r\n, admit_type_denominator as(\r\n select\r\n cast('admit_type_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where admit_type_code is not null\r\n)\r\n\r\n, ms_drg_denominator as(\r\n select\r\n cast('ms_drg_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where ms_drg_code is not null\r\n)\r\n, present_on_admission_denominator as(\r\n select\r\n cast('diagnosis_poa_1 invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_poa_1 is not null\r\n)\r\n\r\n, procedure_code_type_denominator as(\r\n select\r\n cast('procedure_code_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where procedure_code_type is not null\r\n)\r\n, place_of_service_denominator as(\r\n select\r\n cast('place_of_service_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where place_of_service_code is not null\r\n)\r\n, diagnosis_code_type_denominator as(\r\n select\r\n cast('diagnosis_code_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_code_type is not null\r\n)\r\n\r\n, diagnosis_code_denominator as(\r\n select\r\n cast('diagnosis_code_1 invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_code_1 is not null\r\n\r\n)\r\n\r\n, claim_type_denominator as(\r\n select\r\n cast('claim_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type is not null\r\n)\r\n\r\nselect * from institutional_denominator\r\nunion all \r\nselect * from professional_denominator\r\nunion all\r\nselect * from bill_type_denominator\r\nunion all\r\nselect * from revenue_center_denominator\r\nunion all\r\nselect * from discharge_disposition_denominator\r\nunion all\r\nselect * from admit_source_denominator\r\nunion all\r\nselect * from admit_type_denominator\r\nunion all\r\nselect * from ms_drg_denominator\r\nunion all\r\nselect * from present_on_admission_denominator\r\nunion all\r\nselect * from procedure_code_type_denominator\r\nunion all\r\nselect * from place_of_service_denominator\r\nunion all\r\nselect * from diagnosis_code_type_denominator\r\nunion all\r\nselect * from diagnosis_code_denominator\r\nunion all\r\nselect * from claim_type_denominator", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "compiled": true, "compiled_code": "\n\nwith professional_denominator as(\n select \n cast('professional' as TEXT ) as test_denominator_name\n , cast(count(distinct claim_id) as int) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type = 'professional'\n)\n\n, institutional_denominator as(\n select \n cast('institutional' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type = 'institutional'\n)\n\n, all_claim_denominator as(\n select \n cast('all' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type is not null\n)\n\n, bill_type_denominator as(\n select\n cast('bill_type_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where bill_type_code is not null\n)\n\n, revenue_center_denominator as(\n select\n cast('revenue_center_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where revenue_center_code is not null\n)\n\n, discharge_disposition_denominator as(\n select\n cast('discharge_disposition_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where discharge_disposition_code is not null\n)\n, admit_source_denominator as( \n select\n cast('admit_source_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where admit_source_code is not null\n)\n\n, admit_type_denominator as(\n select\n cast('admit_type_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where admit_type_code is not null\n)\n\n, ms_drg_denominator as(\n select\n cast('ms_drg_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where ms_drg_code is not null\n)\n, present_on_admission_denominator as(\n select\n cast('diagnosis_poa_1 invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where diagnosis_poa_1 is not null\n)\n\n, procedure_code_type_denominator as(\n select\n cast('procedure_code_type invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where procedure_code_type is not null\n)\n, place_of_service_denominator as(\n select\n cast('place_of_service_code invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where place_of_service_code is not null\n)\n, diagnosis_code_type_denominator as(\n select\n cast('diagnosis_code_type invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_type is not null\n)\n\n, diagnosis_code_denominator as(\n select\n cast('diagnosis_code_1 invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_1 is not null\n\n)\n\n, claim_type_denominator as(\n select\n cast('claim_type invalid' as TEXT ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type is not null\n)\n\nselect * from institutional_denominator\nunion all \nselect * from professional_denominator\nunion all\nselect * from bill_type_denominator\nunion all\nselect * from revenue_center_denominator\nunion all\nselect * from discharge_disposition_denominator\nunion all\nselect * from admit_source_denominator\nunion all\nselect * from admit_type_denominator\nunion all\nselect * from ms_drg_denominator\nunion all\nselect * from present_on_admission_denominator\nunion all\nselect * from procedure_code_type_denominator\nunion all\nselect * from place_of_service_denominator\nunion all\nselect * from diagnosis_code_type_denominator\nunion all\nselect * from diagnosis_code_denominator\nunion all\nselect * from claim_type_denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_duplicates": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_duplicates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_duplicates"], "alias": "_int_medical_claim_duplicates", "checksum": {"name": "sha256", "checksum": "0da95ed131911d0ade24100da80c0c405d1e32f5c9dd245ed3120eeed2ee586c"}, "config": {"enabled": true, "alias": "_int_medical_claim_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_duplicates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7153978, "relation_name": "tuva.claims_preprocessing._int_medical_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate medical claims' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\ngroup by\r\n claim_id\r\n , claim_line_number\r\nhaving count(*) > 1", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'duplicate_values' as test_category\n , 'duplicate medical claims' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_inst_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_inst_missing_values"], "alias": "_int_medical_claim_inst_missing_values", "checksum": {"name": "sha256", "checksum": "81b2da440c25c7e031f8a529e10fbff0d6309612a5494fc6a4ec84c4206584c1"}, "config": {"enabled": true, "alias": "_int_medical_claim_inst_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_inst_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.706229, "relation_name": "tuva.claims_preprocessing._int_medical_claim_inst_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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('medical_claim'), institutional_missing_column_list, 'institutional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_inst_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith institutional_missing as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'claim_line_number' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_line_number is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where patient_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where member_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_start_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_end_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'bill_type_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where bill_type_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'revenue_center_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where revenue_center_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'hcpcs_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where hcpcs_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'rendering_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where rendering_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where billing_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'facility_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where facility_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'paid_amount' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_amount is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_type is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n from tuva.claims_data_model.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' as column_checked\n from tuva.claims_data_model.medical_claim\n where data_source is null\n and claim_type = 'institutional'\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom institutional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_invalid_values"], "alias": "_int_medical_claim_invalid_values", "checksum": {"name": "sha256", "checksum": "e48a9657319e8baeab0e5afacdf330208a96dd82df052949ebcb28e4eb533854"}, "config": {"enabled": true, "alias": "_int_medical_claim_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_invalid_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7041597, "relation_name": "tuva.claims_preprocessing._int_medical_claim_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith valid_bill_type as(\r\n select\r\n 'bill_type_code invalid' as test_name\r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.bill_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__bill_type')}} tob\r\n on med.bill_type_code = tob.bill_type_code\r\n where med.claim_type = 'institutional'\r\n and tob.bill_type_code is null\r\n and med.bill_type_code is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n, valid_revenue_center as(\r\n select \r\n 'revenue_center_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.revenue_center_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__revenue_center') }} rev\r\n on med.revenue_center_code = rev.revenue_center_code\r\n where med.claim_type = 'institutional'\r\n and rev.revenue_center_code is null\r\n and med.revenue_center_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_discharge_disposition as(\r\n select \r\n 'discharge_disposition_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.discharge_disposition_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__discharge_disposition') }} discharge\r\n on med.discharge_disposition_code = discharge.discharge_disposition_code\r\n where med.claim_type = 'institutional'\r\n and discharge.discharge_disposition_code is null\r\n and med.discharge_disposition_code is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n, valid_admit_source as(\r\n select \r\n 'admit_source_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.admit_source_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__admit_source') }} adsource\r\n on med.admit_source_code = adsource.admit_source_code\r\n where med.claim_type = 'institutional'\r\n and adsource.admit_source_code is null\r\n and med.admit_source_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_admit_type as(\r\n select \r\n 'admit_type_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.admit_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__admit_type') }} adtype\r\n on med.admit_type_code = adtype.admit_type_code\r\n where med.claim_type = 'institutional'\r\n and adtype.admit_type_code is null\r\n and med.admit_type_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_ms_drg as(\r\n select \r\n 'ms_drg_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.ms_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__ms_drg') }} msdrg\r\n on med.ms_drg_code = msdrg.ms_drg_code\r\n where med.claim_type = 'institutional'\r\n and msdrg.ms_drg_code is null\r\n and med.ms_drg_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_apr_drg as(\r\n select \r\n 'apr_drg_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.apr_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__apr_drg') }} aprdrg\r\n on med.apr_drg_code = aprdrg.apr_drg_code\r\n and severity = '1'\r\n where med.claim_type = 'institutional'\r\n and aprdrg.apr_drg_code is null\r\n and med.apr_drg_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_present_on_admission as(\r\n select \r\n 'diagnosis_poa_1 invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_poa_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__present_on_admission') }} poa\r\n on med.diagnosis_poa_1 = poa.present_on_admit_code\r\n where med.claim_type = 'institutional'\r\n and poa.present_on_admit_code is null\r\n and med.diagnosis_poa_1 is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_procedure_code_type as(\r\n select \r\n 'procedure_code_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.procedure_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on med.procedure_code_type = codetype.code_type\r\n where claim_type = 'institutional'\r\n and codetype.code_type is null\r\n and med.procedure_code_type is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_place_of_service as(\r\n select \r\n 'place_of_service_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.place_of_service_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__place_of_service') }} pos\r\n on med.place_of_service_code = pos.place_of_service_code\r\n where claim_type = 'professional'\r\n and pos.place_of_service_code is null\r\n and med.place_of_service_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_diagnosis_code_type as(\r\n select \r\n 'diagnosis_code_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on med.diagnosis_code_type = codetype.code_type\r\n where codetype.code_type is null\r\n and med.diagnosis_code_type is not null\r\n group by\r\n claim_id\r\n)\r\n\r\n, valid_diagnosis_code as(\r\n select \r\n 'diagnosis_code_1 invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_code_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__icd_10_cm') }} icd\r\n on med.diagnosis_code_1 = icd.icd_10_cm\r\n where diagnosis_code_type = 'icd-10-cm'\r\n and icd.icd_10_cm is null\r\n and med.diagnosis_code_1 is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n\r\n, valid_claim_type as(\r\n select \r\n 'claim_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_type' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.claim_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__claim_type') }} claimtype\r\n on med.claim_type = claimtype.claim_type\r\n where claimtype.claim_type is null\r\n and med.claim_type is not null\r\n group by\r\n claim_id\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": [["medical_claim"], ["terminology__bill_type"], ["medical_claim"], ["terminology__revenue_center"], ["medical_claim"], ["terminology__discharge_disposition"], ["medical_claim"], ["terminology__admit_source"], ["medical_claim"], ["terminology__admit_type"], ["medical_claim"], ["terminology__ms_drg"], ["medical_claim"], ["terminology__apr_drg"], ["medical_claim"], ["terminology__present_on_admission"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__place_of_service"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__icd_10_cm"], ["medical_claim"], ["terminology__claim_type"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__discharge_disposition", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__admit_source", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__admit_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__apr_drg", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__present_on_admission", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__claim_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith valid_bill_type as(\n select\n 'bill_type_code invalid' as test_name\n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.bill_type_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.bill_type tob\n on med.bill_type_code = tob.bill_type_code\n where med.claim_type = 'institutional'\n and tob.bill_type_code is null\n and med.bill_type_code is not null\n group by\n claim_id\n\n)\n, valid_revenue_center as(\n select \n 'revenue_center_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.revenue_center_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.revenue_center rev\n on med.revenue_center_code = rev.revenue_center_code\n where med.claim_type = 'institutional'\n and rev.revenue_center_code is null\n and med.revenue_center_code is not null\n group by\n claim_id\n)\n, valid_discharge_disposition as(\n select \n 'discharge_disposition_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.discharge_disposition_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.discharge_disposition discharge\n on med.discharge_disposition_code = discharge.discharge_disposition_code\n where med.claim_type = 'institutional'\n and discharge.discharge_disposition_code is null\n and med.discharge_disposition_code is not null\n group by\n claim_id\n\n)\n, valid_admit_source as(\n select \n 'admit_source_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.admit_source_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.admit_source adsource\n on med.admit_source_code = adsource.admit_source_code\n where med.claim_type = 'institutional'\n and adsource.admit_source_code is null\n and med.admit_source_code is not null\n group by\n claim_id\n)\n, valid_admit_type as(\n select \n 'admit_type_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.admit_type_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.admit_type adtype\n on med.admit_type_code = adtype.admit_type_code\n where med.claim_type = 'institutional'\n and adtype.admit_type_code is null\n and med.admit_type_code is not null\n group by\n claim_id\n)\n, valid_ms_drg as(\n select \n 'ms_drg_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.ms_drg_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.ms_drg msdrg\n on med.ms_drg_code = msdrg.ms_drg_code\n where med.claim_type = 'institutional'\n and msdrg.ms_drg_code is null\n and med.ms_drg_code is not null\n group by\n claim_id\n)\n, valid_apr_drg as(\n select \n 'apr_drg_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.apr_drg_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.apr_drg aprdrg\n on med.apr_drg_code = aprdrg.apr_drg_code\n and severity = '1'\n where med.claim_type = 'institutional'\n and aprdrg.apr_drg_code is null\n and med.apr_drg_code is not null\n group by\n claim_id\n)\n, valid_present_on_admission as(\n select \n 'diagnosis_poa_1 invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.diagnosis_poa_1) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.present_on_admission poa\n on med.diagnosis_poa_1 = poa.present_on_admit_code\n where med.claim_type = 'institutional'\n and poa.present_on_admit_code is null\n and med.diagnosis_poa_1 is not null\n group by\n claim_id\n)\n, valid_procedure_code_type as(\n select \n 'procedure_code_type invalid' as test_name \n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.procedure_code_type) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.code_type codetype\n on med.procedure_code_type = codetype.code_type\n where claim_type = 'institutional'\n and codetype.code_type is null\n and med.procedure_code_type is not null\n group by\n claim_id\n)\n, valid_place_of_service as(\n select \n 'place_of_service_code invalid' as test_name \n , 'medical_claim' as source_table\n , 'professional' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.place_of_service_code) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.place_of_service pos\n on med.place_of_service_code = pos.place_of_service_code\n where claim_type = 'professional'\n and pos.place_of_service_code is null\n and med.place_of_service_code is not null\n group by\n claim_id\n)\n, valid_diagnosis_code_type as(\n select \n 'diagnosis_code_type invalid' as test_name \n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.diagnosis_code_type) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.code_type codetype\n on med.diagnosis_code_type = codetype.code_type\n where codetype.code_type is null\n and med.diagnosis_code_type is not null\n group by\n claim_id\n)\n\n, valid_diagnosis_code as(\n select \n 'diagnosis_code_1 invalid' as test_name \n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'invalid_values' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.diagnosis_code_1) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.icd_10_cm icd\n on med.diagnosis_code_1 = icd.icd_10_cm\n where diagnosis_code_type = 'icd-10-cm'\n and icd.icd_10_cm is null\n and med.diagnosis_code_1 is not null\n group by\n claim_id\n\n)\n\n, valid_claim_type as(\n select \n 'claim_type invalid' as test_name \n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'claim_type' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(med.claim_type) as filled_row_count\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim med\n left join tuva.terminology.claim_type claimtype\n on med.claim_type = claimtype.claim_type\n where claimtype.claim_type is null\n and med.claim_type is not null\n group by\n claim_id\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": []}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_plausibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_plausibility"], "alias": "_int_medical_claim_plausibility", "checksum": {"name": "sha256", "checksum": "3c99fc08f1d20d18e95e6657219391704126aa7ea45cfdccc6f0e2f51b6cfdcd"}, "config": {"enabled": true, "alias": "_int_medical_claim_plausibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_plausibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7228413, "relation_name": "tuva.claims_preprocessing._int_medical_claim_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_start_date_after_claim_end_date as (\r\n select\r\n 'claim start date after claim end date' as test_name\r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_start_date > claim_end_date\r\n group by\r\n claim_id\r\n)\r\n, admission_date_after_discharge_date as (\r\n select\r\n 'admission date after discharge date' as test_name\r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'plausibility' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'institutional'\r\n and admission_date > discharge_date\r\n group by\r\n claim_id\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", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith claim_start_date_after_claim_end_date as (\n select\n 'claim start date after claim end date' as test_name\n , 'medical_claim' as source_table\n , 'all' as claim_type\n , 'plausibility' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(*) as counts\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_start_date > claim_end_date\n group by\n claim_id\n)\n, admission_date_after_discharge_date as (\n select\n 'admission date after discharge date' as test_name\n , 'medical_claim' as source_table\n , 'institutional' as claim_type\n , 'plausibility' as test_category\n , 'claim_id' as grain\n , claim_id\n , count(*) as counts\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\n from tuva.claims_data_model.medical_claim\n where claim_type = 'institutional'\n and admission_date > discharge_date\n group by\n claim_id\n)\n\nselect * from claim_start_date_after_claim_end_date\nunion all\nselect * from admission_date_after_discharge_date", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_prof_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_prof_missing_values"], "alias": "_int_medical_claim_prof_missing_values", "checksum": {"name": "sha256", "checksum": "e5fe39288a98102636082dd5ecaef522b520a9f3775b510adcfbb3be6e3b31f6"}, "config": {"enabled": true, "alias": "_int_medical_claim_prof_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_prof_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7089028, "relation_name": "tuva.claims_preprocessing._int_medical_claim_prof_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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('medical_claim'), professional_missing_column_list, 'professional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_prof_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith professional_missing as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'claim_line_number' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_line_number is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where patient_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.medical_claim\n where member_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_start_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where claim_end_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'place_of_service_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where place_of_service_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'hcpcs_code' as column_checked\n from tuva.claims_data_model.medical_claim\n where hcpcs_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'rendering_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where rendering_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n from tuva.claims_data_model.medical_claim\n where billing_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'paid_amount' as column_checked\n from tuva.claims_data_model.medical_claim\n where paid_amount is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n from tuva.claims_data_model.medical_claim\n where diagnosis_code_type is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n from tuva.claims_data_model.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' as column_checked\n from tuva.claims_data_model.medical_claim\n where data_source is null\n and claim_type = 'professional'\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom professional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__pharmacy_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__pharmacy_claim_duplicates"], "alias": "_int_pharmacy_claim_duplicates", "checksum": {"name": "sha256", "checksum": "977a8102918cf32a3639e2e053ff47fdf7eaae069a647df2729d34cf21505e7d"}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_duplicates", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7483952, "relation_name": "tuva.claims_preprocessing._int_pharmacy_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'pharmacy_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate pharmacy claims' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by\r\n claim_id\r\n , claim_line_number\r\nhaving count(*) > 1", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n 'pharmacy_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'duplicate_values' as test_category\n , 'duplicate pharmacy claims' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__pharmacy_claim_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__pharmacy_claim_missing_values"], "alias": "_int_pharmacy_claim_missing_values", "checksum": {"name": "sha256", "checksum": "9a0b4ef0871caaab4da1c80844187c8095337c1042e09b3500bb47b7280fdbbe"}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_missing_values", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7514782, "relation_name": "tuva.claims_preprocessing._int_pharmacy_claim_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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\n\r\n\r\nwith eligibility_missing as(\r\n\r\n {{ pharmacy_claim_missing_column_check(builtins.ref('pharmacy_claim'), pharmacy_claim_missing_column_list) }}\r\n\r\n)\r\n\r\n\r\nselect\r\n 'pharmacy_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_missing_column_check"], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__pharmacy_claim_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith eligibility_missing as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where claim_id is null\n union all\n select\n claim_id\n , 'claim_line_number' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where claim_line_number is null\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where patient_id is null\n union all\n select\n claim_id\n , 'member_id' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where member_id is null\n union all\n select\n claim_id\n , 'prescribing_provider_npi' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where prescribing_provider_npi is null\n union all\n select\n claim_id\n , 'dispensing_provider_npi' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where dispensing_provider_npi is null\n union all\n select\n claim_id\n , 'dispensing_date' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where dispensing_date is null\n union all\n select\n claim_id\n , 'ndc_code' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where ndc_code is null\n union all\n select\n claim_id\n , 'quantity' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where quantity is null\n union all\n select\n claim_id\n , 'days_supply' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where days_supply is null\n union all\n select\n claim_id\n , 'refills' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where refills is null\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where paid_date is null\n union all\n select\n claim_id\n , 'paid_amount' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where paid_amount is null\n union all\n select\n claim_id\n , 'allowed_amount' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where allowed_amount is null\n union all\n select\n claim_id\n , 'data_source' as column_checked\n from tuva.claims_data_model.pharmacy_claim\n where data_source is null\n \n\n)\n\n\nselect\n 'pharmacy_claim' as source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id \n , 'missing_values' as test_category\n , column_checked||' missing' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__professional_header_failures": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__professional_header_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "unique_id": "model.the_tuva_project.data_profiling__professional_header_failures", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_failures"], "alias": "_int_professional_header_failures", "checksum": {"name": "sha256", "checksum": "5c98a5c0d9918cd08c71123b4e2399c2e9013f42c41281b5cddcbde437403c34"}, "config": {"enabled": true, "alias": "_int_professional_header_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_failures", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.6946578, "relation_name": "tuva.claims_preprocessing._int_professional_header_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith stage as(\r\n select distinct\r\n claim_id\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , claim_start_date\r\n , claim_end_date\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 from {{ ref('medical_claim') }} med\r\n where claim_type = 'professional'\r\n ) \r\n, claims_with_duplicates as (\r\nselect \r\n claim_id\r\n , 1 as invalid_header\r\nfrom stage\r\ngroup by claim_id\r\nhaving count(*) > 1\r\n)\r\n\r\nselect med.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\r\ninner join {{ ref('medical_claim') }} med\r\n on dupe.claim_id = med.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_failures.sql", "compiled": true, "compiled_code": "\n\nwith stage as(\n select distinct\n claim_id\n , claim_type\n , patient_id\n , member_id\n , claim_start_date\n , claim_end_date\n , paid_date\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 , data_source\n from tuva.claims_data_model.medical_claim med\n where claim_type = 'professional'\n ) \n, claims_with_duplicates as (\nselect \n claim_id\n , 1 as invalid_header\nfrom stage\ngroup by claim_id\nhaving count(*) > 1\n)\n\nselect med.*, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run from claims_with_duplicates dupe\ninner join tuva.claims_data_model.medical_claim med\n on dupe.claim_id = med.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__professional_header_fail_details": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__professional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_fail_details"], "alias": "_int_professional_header_fail_details", "checksum": {"name": "sha256", "checksum": "dc413eb5f882b83d9d50e0d454924477c2f41ee13e2232246d6c7905acbb5a8f"}, "config": {"enabled": true, "alias": "_int_professional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_fail_details", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7011704, "relation_name": "tuva.claims_preprocessing._int_professional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , '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 {{ header_duplicate_check(builtins.ref('data_profiling__professional_header_failures'), professional_header_column_list, 'professional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , 'header' as test_category\r\n , column_checked||' duplicated' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_header_duplicates\r\ngroup by \r\n claim_id\r\n , column_checked||' duplicated'", "language": "sql", "refs": [["data_profiling__professional_header_failures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__professional_header_failures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith professional_header_duplicates as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , 'place_of_service_code' as column_checked\n , count(distinct place_of_service_code) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct place_of_service_code) > 1\n union all\n select\n claim_id\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n , count(distinct paid_date) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct paid_date) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from tuva.claims_preprocessing._int_professional_header_failures\n where claim_type = 'professional'\n group by claim_id\n having count(distinct data_source) > 1\n \n\n)\n\nselect\n 'medical_claim' as source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , claim_id\n , 'header' as test_category\n , column_checked||' duplicated' as test_name\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom professional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_eligibility"], "alias": "_int_test_detail_stage_eligibility", "checksum": {"name": "sha256", "checksum": "3ea257ce7d15d19f894d261b9c90e28d2565c9c71a6f58480a9e9380df89f49c"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_eligibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7452006, "relation_name": "tuva.claims_preprocessing._int_test_detail_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_duplicates') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_missing_values') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_invalid_values') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_plausibility') }}", "language": "sql", "refs": [["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_missing_values"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_plausibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_duplicates\n union all\n select distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_missing_values\n union all\n select distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_invalid_values\n union all\n select distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from tuva.claims_preprocessing._int_eligibility_plausibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_medical_claim"], "alias": "_int_test_detail_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "be30aefba51ac1c3e53870f9210c97a3996ecc8c98247451522ab9d97322e7b3"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_medical_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7247665, "relation_name": "tuva.claims_preprocessing._int_test_detail_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n \r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__claim_type_unmapped') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__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\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_plausibility') }}", "language": "sql", "refs": [["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__claim_type_unmapped"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__medical_claim_plausibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n \nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_institutional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_professional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_inst_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_prof_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_invalid_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_claim_type_unmapped\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_claim_type_mapping_failures\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_medical_claim_plausibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_pharmacy_claim"], "alias": "_int_test_detail_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "c57e4871a6e66fe9e628ea04674fd01484c2cccd36cda5da1d951e2f342c1573"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_pharmacy_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7564557, "relation_name": "tuva.claims_preprocessing._int_test_detail_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__pharmacy_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__pharmacy_claim_missing_values') }}", "language": "sql", "refs": [["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_pharmacy_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom tuva.claims_preprocessing._int_pharmacy_claim_missing_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_eligibility": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_eligibility"], "alias": "_int_test_result_stage_eligibility", "checksum": {"name": "sha256", "checksum": "d858540b5b651733e373f80b562f2df639042c582bd632f3381a3c8c87521f11"}, "config": {"enabled": true, "alias": "_int_test_result_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_eligibility", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7373166, "relation_name": "tuva.claims_preprocessing._int_test_result_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__eligibility_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'eligibility'\r\nand test_name not like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__eligibility_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'eligibility'\r\nand test_name like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"], ["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__eligibility_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_eligibility_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'eligibility'\nand test_name not like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_eligibility_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'eligibility'\nand test_name like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_medical_claim"], "alias": "_int_test_result_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "9e09b3dd40cb18b6bd1b99c6dff3ad670e4ea2d7752104d909bcc524b523e125"}, "config": {"enabled": true, "alias": "_int_test_result_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_medical_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7173133, "relation_name": "tuva.claims_preprocessing._int_test_result_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__medical_claim_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'medical_claim'\r\nand test_name not like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\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 , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__medical_claim_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'medical_claim'\r\nand test_name like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"], ["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_medical_claim_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'medical_claim'\nand test_name not like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.test_detail det\ninner join tuva.claims_preprocessing._int_medical_claim_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'medical_claim'\nand test_name like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": {"database": "tuva", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_pharmacy_claim"], "alias": "_int_test_result_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "a8f1577d9baa5e5aca5be82b3ce4fb2cecc5146c888c4fe10fae578753bf0f4c"}, "config": {"enabled": true, "alias": "_int_test_result_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_pharmacy_claim", "tags": "data_profiling", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1694466126.7534733, "relation_name": "tuva.claims_preprocessing._int_test_result_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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) as int) as count\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\n from {{ ref('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 , count(distinct foreign_key) as failures\r\n from {{ ref('data_profiling__test_detail') }}\r\n where source_table = '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 )\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 , claim.failures\r\n , elig.count as denominator\r\n , tuva_last_run\r\n from distinct_patient_per_category claim\r\n left join pharmacy_claim_denominator elig\r\n on claim.claim_type = elig.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 , claim.failures\r\n , elig.count\r\n , tuva_last_run", "language": "sql", "refs": [["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__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) as int) as count\n , cast('2023-09-12 13:15:18.296145+00:00' as TEXT ) as tuva_last_run\n from tuva.claims_data_model.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 , count(distinct foreign_key) as failures\n from tuva.claims_preprocessing.test_detail\n where source_table = 'pharmacy_claim'\n group by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n )\n\n select\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , claim.failures\n , elig.count as denominator\n , tuva_last_run\n from distinct_patient_per_category claim\n left join pharmacy_claim_denominator elig\n on claim.claim_type = elig.claim_type\n group by\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , claim.failures\n , elig.count\n , tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_input_layer_results": {"database": "tuva", "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": "2728cfd1aba4d232de5824afa376f94c6ec17a6760960ddb89577bb53a24b345"}, "config": {"enabled": true, "alias": "_dq_input_layer_results", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8822174, "relation_name": "tuva.claims_preprocessing._dq_input_layer_results", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__dq_input_layer_tests"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "tuva", "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": "dae1f976d3fd577553e88ed12cf87c51114514c03a4c753f3632dc909a664dc1"}, "config": {"enabled": true, "alias": "_dq_input_layer_tests", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.885149, "relation_name": "tuva.claims_preprocessing._dq_input_layer_tests", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__claim_type"], ["service_category__stg_medical_claim"], ["terminology__place_of_service"], ["service_category__stg_medical_claim"], ["terminology__bill_type"], ["service_category__stg_medical_claim"], ["terminology__revenue_center"], ["service_category__stg_medical_claim"], ["terminology__hcpcs_level_2"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["service_category__stg_medical_claim"], ["terminology__apr_drg"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Multiple claim_type' as dq_problem\n, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join tuva.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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "tuva", "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": "a7ccc6fbaedd38265491db76c0dd500b00bbde39f594c5c7c3454ce84cb1c705"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8876073, "relation_name": "tuva.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)))\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": [["service_category__combined_institutional"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_combined_institutional\ngroup by 1\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "tuva", "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": "229ae19e65242bacdae2da2b2c97bc6a8cf238748ec54a53d1aa0d14f77d2405"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.889608, "relation_name": "tuva.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)))\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": [["service_category__combined_professional"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_combined_professional\ngroup by 1,2\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__service_category_grouper": {"database": "tuva", "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": "d6182b55852b375209eb2e17343b2bdd7971fc95714b408177792ec0e1474ec5"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "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, "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, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.7978482, "relation_name": "tuva.claims_preprocessing.service_category_grouper", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect 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\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft 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\nwhere a.claim_type = 'professional'\r\n\r\nunion all\r\n\r\nselect 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\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__combined_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nwhere a.claim_type = 'institutional'", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__combined_professional"], ["service_category__stg_medical_claim"], ["service_category__combined_institutional"]], "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": "\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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.claims_preprocessing._int_combined_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\nunion all\n\nselect 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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.claims_preprocessing._int_combined_institutional b\n on a.claim_id = b.claim_id\nwhere a.claim_type = 'institutional'", "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"database": "tuva", "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": "afe752a80c19139109f0199a02b6bbca127bbea0f5e96ed846c6087995533828"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8058255, "relation_name": "tuva.claims_preprocessing._int_acute_inpatient_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 tuva.terminology.ms_drg msdrg\n on mc.ms_drg_code = msdrg.ms_drg_code\nleft join tuva.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, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "tuva", "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": "27e92517869ec9d26468e1dd8b181b15f8a350babd66a8bfd73c8b82afe49688"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8084252, "relation_name": "tuva.claims_preprocessing._int_acute_inpatient_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct\n claim_id\n, claim_line_number\n, 'Acute Inpatient' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "tuva", "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": "44f209883bcf412c4870a26c12a607c1b3e4090a24206ab65809c5913967531a"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8120189, "relation_name": "tuva.claims_preprocessing._int_ambulance_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Ambulance' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "tuva", "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": "4e5e07316310a0419c13790829deb8ee659e979827caded81cd42a9196634847"}, "config": {"enabled": true, "alias": "_int_ambulatory_surgery_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8150852, "relation_name": "tuva.claims_preprocessing._int_ambulatory_surgery_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Ambulatory Surgery' as service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__combined_institutional": {"database": "tuva", "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": "56860dbf5ecaf891a951089a18a3aa21c48013c9a621964128710046dc3c997a"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.803832, "relation_name": "tuva.claims_preprocessing._int_combined_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\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') }}", "language": "sql", "refs": [["service_category__acute_inpatient_institutional"], ["service_category__dialysis_institutional"], ["service_category__emergency_department_institutional"], ["service_category__home_health_institutional"], ["service_category__hospice_institutional"], ["service_category__lab_institutional"], ["service_category__outpatient_hospital_or_clinic_institutional"], ["service_category__outpatient_psychiatric_institutional"], ["service_category__skilled_nursing_institutional"], ["service_category__urgent_care_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["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\nselect *\nfrom tuva.claims_preprocessing._int_acute_inpatient_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_dialysis_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_emergency_department_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_home_health_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_hospice_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_lab_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_psychiatric_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_skilled_nursing_institutional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_urgent_care_institutional", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__combined_professional": {"database": "tuva", "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": "b019934726b13915965e03d72e9d60b6adf431f634855b85ba2942543af213d5"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8008418, "relation_name": "tuva.claims_preprocessing._int_combined_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__ambulance_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__dme_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') }}", "language": "sql", "refs": [["service_category__acute_inpatient_professional"], ["service_category__ambulance_professional"], ["service_category__ambulatory_surgery_professional"], ["service_category__dialysis_professional"], ["service_category__dme_professional"], ["service_category__emergency_department_professional"], ["service_category__home_health_professional"], ["service_category__hospice_professional"], ["service_category__inpatient_psychiatric_professional"], ["service_category__inpatient_rehab_professional"], ["service_category__lab_professional"], ["service_category__office_visit_professional"], ["service_category__outpatient_hospital_or_clinic_professional"], ["service_category__outpatient_psychiatric_professional"], ["service_category__outpatient_rehab_professional"], ["service_category__skilled_nursing_professional"], ["service_category__urgent_care_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["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_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"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "compiled": true, "compiled_code": "\n\nselect *\nfrom tuva.claims_preprocessing._int_acute_inpatient_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_ambulance_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_ambulatory_surgery_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_dialysis_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_dme_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_emergency_department_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_home_health_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_hospice_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_inpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_inpatient_rehab_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_lab_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_office_visit_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_hospital_or_clinic_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_outpatient_rehab_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_skilled_nursing_professional\n\nunion all\n\nselect *\nfrom tuva.claims_preprocessing._int_urgent_care_professional", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dialysis_institutional": {"database": "tuva", "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": "20e78d709c0ed0460182d80c44a6e17e89af5baa64f42d3630b8ffd609f605cd"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8176556, "relation_name": "tuva.claims_preprocessing._int_dialysis_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Dialysis' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "tuva", "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": "d44b35e28d2318bd5ad888394e5967f4d8641d11299f63ab21ab68393c97d1a7"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.819746, "relation_name": "tuva.claims_preprocessing._int_dialysis_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Dialysis' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dme_professional": {"database": "tuva", "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": "e7afd6e430fa8cdd893ac98646228f7bd33ccc6f64a1c565674ec361dd95a9ef"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8227334, "relation_name": "tuva.claims_preprocessing._int_dme_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Durable Medical Equipment' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "tuva", "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": "0d97b57099e158e3cca511f4394654d3706582ba6f3a60d423b7fc5de1caa5cb"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8247075, "relation_name": "tuva.claims_preprocessing._int_emergency_department_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n 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') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code in ('0450','0451','0452','0459','0981')\r\n and left(bill_type_code,2) in ('13','71','73')\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": [["service_category__stg_medical_claim"]], "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_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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Emergency Department' as service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code in ('0450','0451','0452','0459','0981')\n and left(bill_type_code,2) in ('13','71','73')\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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "tuva", "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": "6dd74ae07d39e1bc9cd076cc3db91c05beb1efc03921bf7a929eeeae16cfeb6a"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.828216, "relation_name": "tuva.claims_preprocessing._int_emergency_department_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Emergency Department' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "tuva", "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": "efb90e774ffe4cb653057354fd144a139dad955f7cab60601388b4d763137ace"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8317919, "relation_name": "tuva.claims_preprocessing._int_home_health_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Home Health' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__home_health_professional": {"database": "tuva", "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": "db35d1592f7e4f81e6f32a949c491323163e8bd032a1bbb763545b7e6ca5e2c3"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.833782, "relation_name": "tuva.claims_preprocessing._int_home_health_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Home Health' as service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "tuva", "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": "3bc8831be11a812e16eae225c7830a2740d9b81d9f50ccec81649b4daa7d828d"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.835776, "relation_name": "tuva.claims_preprocessing._int_hospice_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Hospice' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__hospice_professional": {"database": "tuva", "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": "9a5689f5227edac24e3411d7474e9650b4976702dd244f9e161d806016b8b556"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.839576, "relation_name": "tuva.claims_preprocessing._int_hospice_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Hospice' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "tuva", "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": "b3b9c8cc407ad449f552a3c4253f23c8c3be51564ecb5fc14206799fabf4ad9d"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8415692, "relation_name": "tuva.claims_preprocessing._int_inpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Psychiatric' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "tuva", "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": "202e394bb6ed3de077f9961f8b7eac1a0019b4cbd89cbe8549e82236c927ed3f"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.844165, "relation_name": "tuva.claims_preprocessing._int_inpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Rehabilitation' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__lab_institutional": {"database": "tuva", "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": "ccc73a53515e6e1353b99078dd083379f868eaaea51ae614401b6151c6f4d7e0"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8477354, "relation_name": "tuva.claims_preprocessing._int_lab_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Lab' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__lab_professional": {"database": "tuva", "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": "c0cb05661eb5c335447327f638b0317dad985f25b2485e01275746138b448fbf"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.850799, "relation_name": "tuva.claims_preprocessing._int_lab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Lab' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "tuva", "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": "44ababd289d8045ee2c9140015196a46dfc087cd6173deb0ce511fd30a04b59c"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.852793, "relation_name": "tuva.claims_preprocessing._int_office_visit_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Office Visit' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "tuva", "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": "32ff91af7dcb9e139efd403486bed63509b968fc152a588184a1482bdf2b2321"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8557913, "relation_name": "tuva.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)))\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": [["service_category__stg_medical_claim"], ["service_category__emergency_department_institutional"], ["service_category__urgent_care_institutional"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nleft join tuva.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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "tuva", "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": "1c399c15ab5818875a0316a7f093aa2cc445f4cd8dca48bbdedd8387779ef127"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8574004, "relation_name": "tuva.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)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "tuva", "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": "cc4578150352a181c4b5118b91993beb634abe3b8bb5631bdba9e8cb0f03361f"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8600066, "relation_name": "tuva.claims_preprocessing._int_outpatient_psychiatric_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Outpatient Psychiatric' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "tuva", "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": "e1fa4188a9df6040ced7494410a4e588b9e2d6f4c54d56564324624cdc66f375"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8640566, "relation_name": "tuva.claims_preprocessing._int_outpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Psychiatric' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "tuva", "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": "a82703bf4e7373d72097ea876af395212a4547433e54a6b86a754ea79907ac0a"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8662527, "relation_name": "tuva.claims_preprocessing._int_outpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Rehabilitation' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "tuva", "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": "95189065009a39d41e95fd40c6cf9fbbd50087c6ce48819c993ba85cf7660a62"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8688858, "relation_name": "tuva.claims_preprocessing._int_skilled_nursing_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Skilled Nursing' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "tuva", "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": "c43c5519de8e58ff36fdad21e76aeceef9c48140e4b55c464db4369defb269cd"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8718944, "relation_name": "tuva.claims_preprocessing._int_skilled_nursing_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Skilled Nursing' as service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join tuva.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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "tuva", "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": "06c0e5db157aa4fd77b6ff06f6964994e57d1442c8aaffdd4af00209e72ada7c"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.873862, "relation_name": "tuva.claims_preprocessing._int_urgent_care_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n 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') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code = '0456'\r\n and left(bill_type_code,2) in ('13','71','73')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "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_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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, 'Urgent Care' as service_category_2\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code = '0456'\n and left(bill_type_code,2) in ('13','71','73')", "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "tuva", "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": "997ffe7833fd3ceb34e168fb79278b6b99eb8e0526588cf1aa7d2c8fc212ff0b"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.877019, "relation_name": "tuva.claims_preprocessing._int_urgent_care_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["service_category__stg_medical_claim"]], "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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Urgent Care' as service_category_2\n, '2023-09-12 13:15:18.296145+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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}]}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "2965d28559d54346b2cd74e9da52a2f032c2cc203edaf96744344924335b1235"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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", "enabled": true, "bind": false}, "created_at": 1694466126.8791268, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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'2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"database": "tuva", "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": "52ea94e810313bf1dd20b03a2fe8a33de8a2e443abdf5bf4a97c52490191ca6c"}, "config": {"enabled": true, "alias": "patient_risk_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.896102, "relation_name": "tuva.cms_hcc.patient_risk_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , enrollment_status\r\n || ' / '\r\n || gender\r\n || ' / '\r\n || age_group\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 || ' / '\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 , 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 , enrollment_status_default\r\n , medicaid_dual_status_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 , 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 , 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 , 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 , 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 , 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.institutional_status_default\r\n , unioned.description as risk_factor_description\r\n , unioned.coefficient\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\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(institutional_status_default as boolean) as institutional_status_default\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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , institutional_status_default\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": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_demographic_factors"], ["cms_hcc__int_disease_factors"], ["cms_hcc__int_enrollment_interaction_factors"], ["cms_hcc__int_disabled_interaction_factors"], ["cms_hcc__int_disease_interaction_factors"], ["cms_hcc__int_hcc_count_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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 , enrollment_status\n || ' / '\n || gender\n || ' / '\n || age_group\n || ' / '\n || case\n when medicaid_status = 'Yes' then 'Medicaid'\n else 'Non-Medicaid'\n end\n || ' / '\n || dual_status\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 , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, demographic_defaults as (\n\n select\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n from tuva.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 , model_version\n , payment_year\n from tuva.cms_hcc._int_disease_factors\n\n)\n\n, enrollment_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.cms_hcc._int_enrollment_interaction_factors\n\n)\n\n, disabled_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.cms_hcc._int_disabled_interaction_factors\n\n)\n\n, disease_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.cms_hcc._int_disease_interaction_factors\n\n)\n\n, hcc_counts as (\n\n select\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n from tuva.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.institutional_status_default\n , unioned.description as risk_factor_description\n , unioned.coefficient\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\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(institutional_status_default as boolean) as institutional_status_default\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 , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from add_defaults\n\n)\n\nselect\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , risk_factor_description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "tuva", "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": "1d039532b5f5483d49292e60380f757cbd845d53f53d055625439f754871402a"}, "config": {"enabled": true, "alias": "patient_risk_scores", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model calculates the CMS HCC raw 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, "quote": null, "tags": []}, "raw_risk_score": {"name": "raw_risk_score", "description": "The sum of all patient risk factors.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_risk_score": {"name": "normalized_risk_score", "description": "The raw 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, "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 years rate announcement from CMS.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9007638, "relation_name": "tuva.cms_hcc.patient_risk_scores", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 , round(cast(sum(coefficient) as {{ dbt.type_numeric() }}),3) 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, normalized as (\r\n\r\n select\r\n raw_score.patient_id\r\n , raw_score.risk_score as raw_risk_score\r\n , round(cast(raw_score.risk_score / seed_adjustment_rates.normalization_factor as {{ dbt.type_numeric() }}),3) as normalized_risk_score\r\n , raw_score.model_version\r\n , raw_score.payment_year\r\n from raw_score\r\n left join seed_adjustment_rates\r\n on raw_score.payment_year = seed_adjustment_rates.payment_year\r\n and raw_score.model_version = seed_adjustment_rates.model_version\r\n\r\n)\r\n\r\n, payment as (\r\n\r\n select\r\n normalized.patient_id\r\n , normalized.raw_risk_score\r\n , normalized.normalized_risk_score\r\n , round(cast(normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as {{ dbt.type_numeric() }}),3) as payment_risk_score\r\n , normalized.model_version\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 and normalized.model_version = seed_adjustment_rates.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 , round(cast(raw_risk_score as {{ dbt.type_numeric() }}),3) as raw_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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from payment\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , raw_risk_score\r\n , normalized_risk_score\r\n , payment_risk_score\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": [["cms_hcc__adjustment_rates"], ["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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 tuva.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 tuva.cms_hcc.patient_risk_factors\n\n)\n\n, raw_score as (\n\n select\n patient_id\n , round(cast(sum(coefficient) as numeric(28,6)),3) 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, normalized as (\n\n select\n raw_score.patient_id\n , raw_score.risk_score as raw_risk_score\n , round(cast(raw_score.risk_score / seed_adjustment_rates.normalization_factor as numeric(28,6)),3) as normalized_risk_score\n , raw_score.model_version\n , raw_score.payment_year\n from raw_score\n left join seed_adjustment_rates\n on raw_score.payment_year = seed_adjustment_rates.payment_year\n and raw_score.model_version = seed_adjustment_rates.model_version\n\n)\n\n, payment as (\n\n select\n normalized.patient_id\n , normalized.raw_risk_score\n , normalized.normalized_risk_score\n , round(cast(normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as numeric(28,6)),3) as payment_risk_score\n , normalized.model_version\n , normalized.payment_year\n from normalized\n left join seed_adjustment_rates\n on normalized.payment_year = seed_adjustment_rates.payment_year\n and normalized.model_version = seed_adjustment_rates.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , round(cast(raw_risk_score as numeric(28,6)),3) as raw_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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from payment\n\n)\n\nselect\n patient_id\n , raw_risk_score\n , normalized_risk_score\n , payment_risk_score\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "tuva", "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": "256636e9e87a1b0f86e10beb0405f9802b69e53a9beba3f141f972f934985d9d"}, "config": {"enabled": true, "alias": "_int_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9057572, "relation_name": "tuva.cms_hcc._int_demographic_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , institutional_status_default\r\n , model_version\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 and model_version = '{{ model_version_compiled }}'\r\n\r\n)\r\n\r\n, 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.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\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\r\n)\r\n\r\n, 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.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\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\r\n)\r\n\r\n/*\r\n The CMS-HCC model does not have factors for ESRD or null medicare status\r\n for these edge-cases, we default to 'Aged' and dual_status is Non or Partial.\r\n*/\r\n, other_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.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\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 where seed_demographic_factors.orec = 'Aged'\r\n and (members.orec = 'ESRD'\r\n or members.orec is null)\r\n and (seed_demographic_factors.dual_status in ('Non', 'Partial')\r\n or seed_demographic_factors.dual_status is null)\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from new_enrollees\r\n union all\r\n select * from continuining_enrollees\r\n union all\r\n select * from other_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(institutional_status_default as boolean) as institutional_status_default\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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , institutional_status_default\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": [["cms_hcc__int_members"], ["cms_hcc__demographic_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , institutional_status_default\n , model_version\n , payment_year\n from tuva.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 tuva.cms_hcc._value_set_demographic_factors\n where plan_segment is null /* data not available */\n and model_version = 'CMS-HCC-V24'\n\n)\n\n, 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.institutional_status_default\n , members.model_version\n , members.payment_year\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\n)\n\n, 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.institutional_status_default\n , members.model_version\n , members.payment_year\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\n)\n\n/*\n The CMS-HCC model does not have factors for ESRD or null medicare status\n for these edge-cases, we default to 'Aged' and dual_status is Non or Partial.\n*/\n, other_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.institutional_status_default\n , members.model_version\n , members.payment_year\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 where seed_demographic_factors.orec = 'Aged'\n and (members.orec = 'ESRD'\n or members.orec is null)\n and (seed_demographic_factors.dual_status in ('Non', 'Partial')\n or seed_demographic_factors.dual_status is null)\n\n)\n\n, unioned as (\n\n select * from new_enrollees\n union all\n select * from continuining_enrollees\n union all\n select * from other_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(institutional_status_default as boolean) as institutional_status_default\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 , cast('2023-09-12 09:15:52' as TIMESTAMP) as date_calculated\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 , institutional_status_default\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "tuva", "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": "3161edd55b2c1a490158435e962f2732f8e8fdf9eff3e42cc72de36b2676fa0b"}, "config": {"enabled": true, "alias": "_int_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9099236, "relation_name": "tuva.cms_hcc._int_disabled_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 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 , 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 where model_version = '{{ model_version_compiled }}'\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\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.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\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\nfrom interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , 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": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disabled_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , institutional_status\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , enrollment_status\n , institutional_status\n , short_name\n , description\n , hcc_code\n , coefficient\n from tuva.cms_hcc._value_set_disabled_interaction_factors\n where model_version = 'CMS-HCC-V24'\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\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.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\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\nfrom interactions\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "tuva", "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": "78a840f230bdc382519836e94e0b2ce75ce4d3e36e4454ec81faa46e3b3e4953"}, "config": {"enabled": true, "alias": "_int_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9149961, "relation_name": "tuva.cms_hcc._int_disease_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , institutional_status_default\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 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 , 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 where model_version = '{{ model_version_compiled }}'\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.enrollment_status_default\r\n , demographics.medicaid_dual_status_default\r\n , demographics.institutional_status_default\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\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.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\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_disease_factors as (\n\n select\n model_version\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , hcc_code\n , description\n , coefficient\n from tuva.cms_hcc._value_set_disease_factors\n where model_version = 'CMS-HCC-V24'\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.enrollment_status_default\n , demographics.medicaid_dual_status_default\n , demographics.institutional_status_default\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\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.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\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from disease_factors\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "tuva", "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": "718708e0f1411feba43711f034c219e8fe846143dd1a02eacb40a6fa73e608d9"}, "config": {"enabled": true, "alias": "_int_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9196494, "relation_name": "tuva.cms_hcc._int_disease_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , institutional_status_default\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 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 , 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 where model_version = '{{ model_version_compiled }}'\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.enrollment_status_default\r\n , demographics.medicaid_dual_status_default\r\n , demographics.institutional_status_default\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\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.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\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.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)\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\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 tuva.cms_hcc._value_set_disease_interaction_factors\n where model_version = 'CMS-HCC-V24'\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.enrollment_status_default\n , demographics.medicaid_dual_status_default\n , demographics.institutional_status_default\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\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.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\n)\n\n, disease_interactions as (\n\n select\n demographics_with_interactions.patient_id\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)\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from disease_interactions\n\n)\n\nselect\n patient_id\n , hcc_code_1\n , hcc_code_2\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "tuva", "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": "658b61d3229d9500498b1339abeffd5b20fa430c3d9f3bbaaec576882ce9c485"}, "config": {"enabled": true, "alias": "_int_eligible_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9236338, "relation_name": "tuva.cms_hcc._int_eligible_conditions", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 and collection year variables.\r\n - The hcc_model_version and payment_year vars have been set here\r\n so they get compiled.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\r\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\r\n{% set collection_year = payment_year_compiled - 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_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_compiled }}\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_compiled }}\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('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\r\n , cast('{{ payment_year_compiled }}' as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from eligible_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_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": [["cms_hcc__stg_medical_claim"], ["cms_hcc__stg_core__condition"], ["cms_hcc__cpt_hcpcs"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.cms_hcc__stg_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 and collection year variables.\n - The hcc_model_version and payment_year vars have been set here\n so they get compiled.\n - The collection year is one year prior to the payment year.\n*/\n\nwith __dbt__cte__cms_hcc__stg_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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n), __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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_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 tuva.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) = 2022\n and cpt_hcpcs_list.payment_year = 2023\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) = 2022\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) = 2022\n and cpt_hcpcs_list.payment_year = 2023\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('CMS-HCC-V24' as TEXT) as model_version\n , cast('2023' as integer) as payment_year\n , cast('2023-09-12 09:15:52' as TIMESTAMP) as date_calculated\n from eligible_conditions\n\n)\n\nselect\n patient_id\n , condition_code\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_medical_claim", "sql": " __dbt__cte__cms_hcc__stg_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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}]}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "tuva", "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": "5a60e406275e7558a659fd9df4208d6596a603496cfcf8b4d16f84f85136af3f"}, "config": {"enabled": true, "alias": "_int_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9281893, "relation_name": "tuva.cms_hcc._int_enrollment_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , institutional_status_default\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 , gender\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__enrollment_interaction_factors') }}\r\n where model_version = '{{ model_version_compiled }}'\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.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 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.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 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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , 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": [["cms_hcc__int_demographic_factors"], ["cms_hcc__enrollment_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 , enrollment_status_default\n , medicaid_dual_status_default\n , institutional_status_default\n , model_version\n , payment_year\n from tuva.cms_hcc._int_demographic_factors\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , gender\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , description\n , coefficient\n from tuva.cms_hcc._value_set_enrollment_interaction_factors\n where model_version = 'CMS-HCC-V24'\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.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 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.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 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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-12 09:15:52' as TIMESTAMP) as date_calculated\n from unioned\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "tuva", "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": "6c13c8bf450c01501197470bd61de44bf61e7a8e713698a9eb2bd144d0497c93"}, "config": {"enabled": true, "alias": "_int_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9331763, "relation_name": "tuva.cms_hcc._int_hcc_count_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\nThe hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 , 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 where model_version = '{{ model_version_compiled }}'\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 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 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.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\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(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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 , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__payment_hcc_count_factors"], ["cms_hcc__int_hcc_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\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 tuva.cms_hcc._int_demographic_factors\n\n)\n\n, seed_payment_hcc_count_factors as (\n\n select\n model_version\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , payment_hcc_count\n , description\n , coefficient\n from tuva.cms_hcc._value_set_payment_hcc_count_factors\n where model_version = 'CMS-HCC-V24'\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from tuva.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 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.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\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(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from hcc_counts\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "tuva", "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": "db16fe4ff61d27cde25f8388baa7f2a8ee7cae8da01aa74d5a3c40fa16df92b9"}, "config": {"enabled": true, "alias": "_int_hcc_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9371626, "relation_name": "tuva.cms_hcc._int_hcc_hierarchy", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n/*\r\n Staging HCCs that will be used in disease factor calculations.\r\n Final output 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 The hcc_model_version var has been set here so it gets compiled.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 where model_version = '{{ model_version_compiled }}'\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 left join seed_hcc_hierarchy as hcc_exclusions\r\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\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\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 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 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 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 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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\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": [["cms_hcc__int_hcc_mapping"], ["cms_hcc__disease_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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 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 The hcc_model_version var has been set here so it gets compiled.\n*/\n\nwith hcc_mapping as (\n\n select distinct\n patient_id\n , hcc_code\n , model_version\n , payment_year\n from tuva.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 tuva.cms_hcc._value_set_disease_hierarchy\n where model_version = 'CMS-HCC-V24'\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 left join seed_hcc_hierarchy as hcc_exclusions\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\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\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 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 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 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 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 , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from unioned\n\n)\n\nselect\n patient_id\n , model_version\n , payment_year\n , hcc_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "tuva", "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": "1c99c0a9ba5961952dce78fe29c00ad7c73e7fa43f3a8700db438af6f35895f4"}, "config": {"enabled": true, "alias": "_int_hcc_mapping", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9476714, "relation_name": "tuva.cms_hcc._int_hcc_mapping", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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\r\n\r\nJinja is used to set payment and collection year variables.\r\n - The hcc_model_version and payment_year vars have been set here\r\n so they get compiled.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\r\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , condition_code\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_eligible_conditions') }}\r\n\r\n)\r\n\r\n/*\r\n Using jinja to choose the correct column based on hcc_model_version var.\r\n*/\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n diagnosis_code\r\n , cms_hcc_v24 as hcc_code /* will be replaced with logic to use correct col based on version var */\r\n from {{ ref('cms_hcc__icd_10_cm_mappings') }}\r\n where payment_year = {{ payment_year_compiled }}\r\n and cms_hcc_v24_flag = 'Yes' /* will be replaced with logic to use correct col based on version var */\r\n\r\n)\r\n\r\n, mapped as (\r\n\r\n select distinct\r\n conditions.patient_id\r\n , conditions.condition_code\r\n , conditions.model_version\r\n , conditions.payment_year\r\n , seed_hcc_mapping.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\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 , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from mapped\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": [["cms_hcc__int_eligible_conditions"], ["cms_hcc__icd_10_cm_mappings"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "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\n\nJinja is used to set payment and collection year variables.\n - The hcc_model_version and payment_year vars have been set here\n so they get compiled.\n - The collection year is one year prior to the payment year.\n*/\n\nwith conditions as (\n\n select\n patient_id\n , condition_code\n , model_version\n , payment_year\n from tuva.cms_hcc._int_eligible_conditions\n\n)\n\n/*\n Using jinja to choose the correct column based on hcc_model_version var.\n*/\n, seed_hcc_mapping as (\n\n select\n diagnosis_code\n , cms_hcc_v24 as hcc_code /* will be replaced with logic to use correct col based on version var */\n from tuva.cms_hcc._value_set_icd_10_cm_mappings\n where payment_year = 2023\n and cms_hcc_v24_flag = 'Yes' /* will be replaced with logic to use correct col based on version var */\n\n)\n\n, mapped as (\n\n select distinct\n conditions.patient_id\n , conditions.condition_code\n , conditions.model_version\n , conditions.payment_year\n , seed_hcc_mapping.hcc_code\n from conditions\n inner join seed_hcc_mapping\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\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 , cast('2023-09-12 09:15:53' as TIMESTAMP) as date_calculated\n from mapped\n\n)\n\nselect\n patient_id\n , condition_code\n , hcc_code\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_members": {"database": "tuva", "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": "a63fd275e8fd84ba339510b30e0fdfe659ea424ec3aa611b69060ac7163fb108"}, "config": {"enabled": true, "alias": "_int_members", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9557266, "relation_name": "tuva.cms_hcc._int_members", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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.\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 and collection year variables.\r\n - The hcc_model_version and payment_year vars have been set here\r\n so they get 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 model_version_compiled = var('cms_hcc_model_version') -%}\r\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\r\n{% set payment_year_age_date = payment_year_compiled ~ '-02-01' -%}\r\n{% set collection_year = payment_year_compiled - 1 -%}\r\n{% set collection_year_start = collection_year ~ '-01-01' -%}\r\n\r\nwith stg_eligibility as (\r\n\r\n select\r\n patient_id\r\n , gender\r\n , birth_date\r\n , floor({{ datediff('birth_date', \"'\"~payment_year_age_date~\"'\", 'hour') }} / 8766.0) as payment_year_age\r\n , enrollment_start_date\r\n , enrollment_end_date\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_eligibility') }}\r\n\r\n)\r\n\r\n, calculate_prior_coverage as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_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 , enrollment_end_date\r\n , case\r\n when enrollment_start_date < '{{ collection_year_start }}'\r\n then {{ datediff(\"'\"~collection_year_start~\"'\", 'enrollment_end_date', 'month') }} +1 /* include starting month */\r\n else {{ datediff('enrollment_start_date', 'enrollment_end_date', 'month') }} +1 /* include starting month */\r\n end as coverage_months\r\n from stg_eligibility\r\n where\r\n /* coverage dates must fall within the collection year */\r\n (extract(year from enrollment_start_date) = {{ collection_year }}\r\n or extract(year from enrollment_start_date) = {{ collection_year }})\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 distinct\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_eligibility.gender\r\n , stg_eligibility.payment_year_age\r\n , stg_eligibility.dual_status_code\r\n , stg_eligibility.medicare_status_code\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 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 , 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_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 /*, null as plan_segment --data not available */\r\n , cast(case\r\n when gender = 'female' then 'Female'\r\n when gender = 'male' then 'Male'\r\n else null\r\n end as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(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 {{ dbt.type_string() }}) as medicaid_status\r\n , cast(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 {{ dbt.type_string() }}) as dual_status\r\n /*\r\n Medicare status is being used as an analog for OREC to calculate\r\n demographic risk factors, this will be replaced when OREC is added to\r\n the data model.\r\n */\r\n , cast(case\r\n when medicare_status_code in ('10','11') then 'Aged'\r\n when medicare_status_code in ('20','21') then 'Disabled'\r\n when medicare_status_code in ('31') then 'ESRD'\r\n end as {{ dbt.type_string() }}) as orec\r\n /*\r\n Defaulting everyone to non-institutional until logic is added\r\n */\r\n , cast('No'as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(case\r\n when dual_status_code is null then True\r\n else FALSE\r\n end as boolean) as medicaid_dual_status_default\r\n , cast(True as boolean) as institutional_status_default\r\n , cast('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\r\n , cast('{{ payment_year_compiled }}' as integer) as payment_year\r\n , cast('{{ dbt_utils.pretty_time(format=\"%Y-%m-%d %H:%M:%S\") }}' as {{ dbt.type_timestamp() }}) as date_calculated\r\n from add_age_group\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 , institutional_status_default\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": [["cms_hcc__stg_eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string", "macro.dbt_utils.pretty_time", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.cms_hcc__stg_eligibility"]}, "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.\n 3) Add age groups based on the payment year.\n 4) Determine other statuses.\n\nJinja is used to set payment and collection year variables.\n - The hcc_model_version and payment_year vars have been set here\n so they get 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_eligibility as (\n\nselect\n patient_id\n , gender\n , birth_date\n , enrollment_start_date\n , enrollment_end_date\n , dual_status_code\n , medicare_status_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n),stg_eligibility as (\n\n select\n patient_id\n , gender\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n '2023-02-01'\n ) / 8766.0) as payment_year_age\n , enrollment_start_date\n , enrollment_end_date\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_eligibility\n\n)\n\n, calculate_prior_coverage as (\n\n select\n patient_id\n , enrollment_start_date\n , case\n when enrollment_start_date < '2022-01-01'\n then '2022-01-01'\n else enrollment_start_date\n end as proxy_enrollment_start_date\n , enrollment_end_date\n , case\n when enrollment_start_date < '2022-01-01'\n then datediff(\n month,\n '2022-01-01',\n enrollment_end_date\n ) +1 /* include starting month */\n else datediff(\n month,\n enrollment_start_date,\n enrollment_end_date\n ) +1 /* include starting month */\n end as coverage_months\n from stg_eligibility\n where\n /* coverage dates must fall within the collection year */\n (extract(year from enrollment_start_date) = 2022\n or extract(year from enrollment_start_date) = 2022)\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 distinct\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_eligibility.gender\n , stg_eligibility.payment_year_age\n , stg_eligibility.dual_status_code\n , stg_eligibility.medicare_status_code\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 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 , 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_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 /*, null as plan_segment --data not available */\n , cast(case\n when gender = 'female' then 'Female'\n when gender = 'male' then 'Male'\n else null\n end as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(case\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\n else 'No'\n end as TEXT) as medicaid_status\n , cast(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 TEXT) as dual_status\n /*\n Medicare status is being used as an analog for OREC to calculate\n demographic risk factors, this will be replaced when OREC is added to\n the data model.\n */\n , cast(case\n when medicare_status_code in ('10','11') then 'Aged'\n when medicare_status_code in ('20','21') then 'Disabled'\n when medicare_status_code in ('31') then 'ESRD'\n end as TEXT) as orec\n /*\n Defaulting everyone to non-institutional until logic is added\n */\n , cast('No'as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(case\n when dual_status_code is null then True\n else FALSE\n end as boolean) as medicaid_dual_status_default\n , cast(True as boolean) as institutional_status_default\n , cast('CMS-HCC-V24' as TEXT) as model_version\n , cast('2023' as integer) as payment_year\n , cast('2023-09-12 09:15:51' as TIMESTAMP) as date_calculated\n from add_age_group\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 , institutional_status_default\n , model_version\n , payment_year\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_eligibility", "sql": " __dbt__cte__cms_hcc__stg_eligibility as (\n\nselect\n patient_id\n , gender\n , birth_date\n , enrollment_start_date\n , enrollment_end_date\n , dual_status_code\n , medicare_status_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}]}, "model.the_tuva_project.cms_hcc__stg_core__condition": {"database": "tuva", "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": "82f6033156f73aa794aea254ea8e4145a1a229fef71da02b57c85be19b9b0411"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.958335, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\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": [["core__condition"]], "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 , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_eligibility": {"database": "tuva", "schema": "cms_hcc", "name": "cms_hcc__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_eligibility.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_eligibility.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_eligibility", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "244f02f21fe9131012c12cacac50cd1ee122a46d677ba2554ea770835c91441c"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.9639332, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , gender\r\n , birth_date\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , dual_status_code\r\n , medicare_status_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_eligibility.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , gender\n , birth_date\n , enrollment_start_date\n , enrollment_end_date\n , dual_status_code\n , medicare_status_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_medical_claim": {"database": "tuva", "schema": "cms_hcc", "name": "cms_hcc__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_medical_claim.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_medical_claim", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "9110c166e02c6867fcee744f43c6a30b9588722b327b72dcced1c49c9a12dec9"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging medical claims from the input layer.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466126.968092, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__condition": {"database": "tuva", "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": "6bf20ce96592d16fd9ab798870231dc2cb5fd32632e677db4eccf028738d1a4f"}, "config": {"enabled": true, "alias": "condition", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core condition table", "columns": {"condition_id": {"name": "condition_id", "description": "Unique id for each condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique encounter_id for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Reported date in when the condition began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date in which the condition was resolved.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466126.9844162, "relation_name": "tuva.core.condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\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": [["core__stg_claims_condition"], ["core__stg_clinical_condition"]], "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 tuva.core._stg_claims_condition\nunion all\nselect * from tuva.core._stg_clinical_condition\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__eligibility": {"database": "tuva", "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": "6c4444c95ace83c2f6bc4f2e9dfc69bef360c3b0a01bea5e67b3da4761485111"}, "config": {"enabled": true, "alias": "eligibility", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core eligibility table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466126.9935298, "relation_name": "tuva.core.eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_eligibility')}}", "language": "sql", "refs": [["core__stg_claims_eligibility"]], "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 tuva.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__encounter": {"database": "tuva", "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": "2cf0a388e7ed3dbd677997974437d8ac82992cf599c035a9b3e6a66d2cfeb133"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the encounter (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code relevant to the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0041187, "relation_name": "tuva.core.encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\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": [["core__stg_clinical_encounter"]], "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 tuva.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__lab_result": {"database": "tuva", "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": "f9476ba4518a0bd40ed1de34b409cd2a90558632afa56fb482ab58b016ad4ab9"}, "config": {"enabled": true, "alias": "lab_result", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0061123, "relation_name": "tuva.core.lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_clinical_lab_result')}}", "language": "sql", "refs": [["core__stg_clinical_lab_result"]], "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 tuva.core._stg_clinical_lab_result", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__location": {"database": "tuva", "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": "c37dfb21d3e6de4641e1cb7413e8f44db8eab3f488ee294f7cec3f1e04518273"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0096061, "relation_name": "tuva.core.location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_location"], ["core__stg_clinical_location"]], "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 tuva.core._stg_claims_location\nunion all\nselect * from tuva.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__medical_claim": {"database": "tuva", "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": "b126bbc3a07a5f93f701d0199e8fde6ef13a7fd9ac7ad71619de948a8d49fdc1"}, "config": {"enabled": true, "alias": "medical_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core medical_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "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", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0255654, "relation_name": "tuva.core.medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_medical_claim')}}", "language": "sql", "refs": [["core__stg_claims_medical_claim"]], "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 tuva.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__medication": {"database": "tuva", "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": "465c23d0e83d37bcd661cec2d9e6b14101d171d7dc5b1481e9ef8e0580998512"}, "config": {"enabled": true, "alias": "medication", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0290685, "relation_name": "tuva.core.medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_medication')}}", "language": "sql", "refs": [["core__stg_clinical_medication"]], "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 tuva.core._stg_clinical_medication", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__observation": {"database": "tuva", "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": "8e922586d391bb227ab514044d20f47f328a489ae785158adf2d12a7f1c84d4b"}, "config": {"enabled": true, "alias": "observation", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0320604, "relation_name": "tuva.core.observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_observation')}}", "language": "sql", "refs": [["core__stg_clinical_observation"]], "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 tuva.core._stg_clinical_observation", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__patient": {"database": "tuva", "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": "b61f67fdabee3aa43bcbc17b1deb9f655a317e812c6571a11caf3f26b22e2ed8"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core patient table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0395434, "relation_name": "tuva.core.patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_patient"], ["core__stg_clinical_patient"]], "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 tuva.core._stg_claims_patient\nunion all\nselect * from tuva.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__pharmacy_claim": {"database": "tuva", "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": "d6e2bac51e9f18580249d402ed5ddc88c616d33d70781c4adf4dfd980499f836"}, "config": {"enabled": true, "alias": "pharmacy_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core pharmacy_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.048029, "relation_name": "tuva.core.pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_claims_pharmacy_claim')}}", "language": "sql", "refs": [["core__stg_claims_pharmacy_claim"]], "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 tuva.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__practitioner": {"database": "tuva", "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": "775c1a9019c7dad8bd26cdb669cfa8f56e61ced3adcb492b805165d42f20eacf"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core provider table with all providers in the claims dataset", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0530555, "relation_name": "tuva.core.practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_practitioner"], ["core__stg_clinical_practitioner"]], "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 tuva.core._stg_claims_practitioner\nunion all\nselect * from tuva.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__procedure": {"database": "tuva", "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": "2ec212aa41f812304773bc51f2ae8bd67767d75b2fb2f29f79ad916c04ba83d2"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core procedure table", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.0604644, "relation_name": "tuva.core.procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\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_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": [["core__stg_claims_procedure"], ["core__stg_clinical_procedure"]], "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 tuva.core._stg_claims_procedure\nunion all\nselect * from tuva.core._stg_clinical_procedure\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_condition": {"database": "tuva", "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": "77c24ac1c2067ef3cee11ab1ed4d77a18c285ef4431eebcd712862f1e5c719ec"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core condition table", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique encounter_id for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Date in which the condition occured.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.1018004, "relation_name": "tuva.core._stg_claims_condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n\t discharge_date,\r\n\t claim_end_date,\r\n\t claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('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 claim_line_start_date,\r\n discharge_date,\r\n claim_end_date,\r\n claim_line_end_date) as condition_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('medical_claim') }} \r\nwhere diagnosis_code_25 is not null\r\n\r\n)\r\n\r\nselect distinct\r\n cast(null as {{ dbt.type_string() }} ) as condition_id,\r\n cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id,\r\n cast(eg.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.condition_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(case\r\n when icd.icd_10_cm is not null then 'icd-10-cm'\r\n end as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast(icd.icd_10_cm as {{ dbt.type_string() }} ) as normalized_code,\r\n cast(icd.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_data_for_medical_claims')}} as eg\r\n on unpivot_cte.claim_id = eg.claim_id\r\n and unpivot_cte.patient_id = eg.patient_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": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["acute_inpatient__encounter_data_for_medical_claims"], ["terminology__icd_10_cm"], ["terminology__present_on_admission"]], "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.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "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": "\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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n\t discharge_date,\n\t claim_end_date,\n\t claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.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 claim_line_start_date,\n discharge_date,\n claim_end_date,\n claim_line_end_date) as condition_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 tuva.claims_data_model.medical_claim \nwhere diagnosis_code_25 is not null\n\n)\n\nselect distinct\n cast(null as TEXT ) as condition_id,\n cast(unpivot_cte.patient_id as TEXT ) as patient_id,\n cast(eg.encounter_id as TEXT ) as encounter_id,\n cast(unpivot_cte.claim_id as TEXT ) as claim_id,\n try_cast( unpivot_cte.condition_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(case\n when icd.icd_10_cm is not null then 'icd-10-cm'\n end as TEXT ) as normalized_code_type,\n cast(icd.icd_10_cm as TEXT ) as normalized_code,\n cast(icd.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('2023-09-12 13:15:18.296145+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\nleft join tuva.claims_preprocessing._int_encounter_data_for_medical_claims as eg\n on unpivot_cte.claim_id = eg.claim_id\n and unpivot_cte.patient_id = eg.patient_id\nleft join tuva.terminology.icd_10_cm icd\n on unpivot_cte.source_code = icd.icd_10_cm\nleft join tuva.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": []}, "model.the_tuva_project.core__stg_claims_eligibility": {"database": "tuva", "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": "08add46bceb7f3be60c8ab11301f4113c5a329c696baa328dcc0a294b1d803bb"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core eligibility table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.1232002, "relation_name": "tuva.core._stg_claims_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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(gender as {{ dbt.type_string() }} ) as gender\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 integer ) as death_flag\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(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(first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\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(phone as {{ dbt.type_string() }} ) as phone\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('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_eligibility.sql", "compiled": true, "compiled_code": "\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(gender as TEXT ) as gender\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 integer ) as death_flag\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(dual_status_code as TEXT ) as dual_status_code\n , cast(medicare_status_code as TEXT ) as medicare_status_code\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\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(phone as TEXT ) as phone\n , cast(data_source as TEXT ) as data_source\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "tuva", "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": "421d66bed54f225f1dafeec781b885446333cce38d7e4beb5ca82aad62a1361c"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core encounter table", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the encounter (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the encounter (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.0857906, "relation_name": "tuva.core._stg_claims_encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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(null as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(null 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') }}", "language": "sql", "refs": [["acute_inpatient__summary"]], "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.acute_inpatient__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_encounter.sql", "compiled": true, "compiled_code": "\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(null as TEXT ) as primary_diagnosis_code\n , cast(null 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('2023-09-12 13:15:18.296145+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_preprocessing.acute_inpatient_summary", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_location": {"database": "tuva", "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": "2b02d9e557b871867f284fc790abb1ab1881d1427309d84c3a34c2753e13be57"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core patient table", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.0884275, "relation_name": "tuva.core._stg_claims_location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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) = '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": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["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": "\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom tuva.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( '2023-09-12 13:15:18.296145+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "tuva", "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": "ad18c22c48b699d30f1b0b538bf53cb8324f1ce7af8d9d378908458af8bd5224"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core medical_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "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).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "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", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.0763562, "relation_name": "tuva.core._stg_claims_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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(enc.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 , {{ 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_int() }} ) 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.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('medical_claim') }} med\r\ninner 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') }} enc\r\n on med.claim_id = enc.claim_id", "language": "sql", "refs": [["medical_claim"], ["service_category__service_category_grouper"], ["acute_inpatient__encounter_id"]], "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.claims_data_model.medical_claim", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.acute_inpatient__encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_medical_claim.sql", "compiled": true, "compiled_code": "\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(enc.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 , 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 INT ) 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.total_cost_amount as numeric(28,6) ) as total_cost_amount\n , cast(med.data_source as TEXT ) as data_source\n , cast('2023-09-12 13:15:18.296145+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.medical_claim med\ninner join tuva.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 tuva.claims_preprocessing._int_acute_inpatient_encounter_id enc\n on med.claim_id = enc.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_patient": {"database": "tuva", "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": "64d72c3505c148dbf13cc09e23dd93d8ee87d6b0c6fa19625e56a789a3c40ab9"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core patient table", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.0953355, "relation_name": "tuva.core._stg_claims_patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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 ,gender\r\n ,race\r\n ,birth_date\r\n ,death_date\r\n ,death_flag\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 ,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('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(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 logitude\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": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.claims_data_model.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_patient.sql", "compiled": true, "compiled_code": "\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 ,gender\n ,race\n ,birth_date\n ,death_date\n ,death_flag\n ,first_name\n ,last_name\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 tuva.claims_data_model.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(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 logitude\n , cast(data_source as TEXT) as data_source\n , cast('2023-09-12 13:15:18.296145+00:00' as TIMESTAMP) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "tuva", "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": "b6cf9d784d80295a9d94102f3406a486f62c3e41dccff6ff32e9a1d336a276c6"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core pharmacy_claim table", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "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", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "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.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.1139593, "relation_name": "tuva.core._stg_claims_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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(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(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.claims_data_model.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "compiled": true, "compiled_code": "\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(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(data_source as TEXT ) as data_source\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "tuva", "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": "e9484f724915ae7eb934a92f6dc139b1c0d4b5f876ff9b608238363c81566e44"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core provider table with all providers in the claims dataset", "columns": {"npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "entity_type_code": {"name": "entity_type_code", "description": "Code that describes the type of provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entity_type_description": {"name": "entity_type_description", "description": "Description of the type of provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_taxonomy_code": {"name": "primary_taxonomy_code", "description": "Code corresponding to the primary specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_specialty_description": {"name": "primary_specialty_description", "description": "Description of the primary specialty for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_name": {"name": "provider_name", "description": "Name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_organization_name": {"name": "parent_organization_name", "description": "Name of the parent organization for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_address_line_1": {"name": "practice_address_line_1", "description": "The first line of the address for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_address_line_2": {"name": "practice_address_line_2", "description": "The second line of the address for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_city": {"name": "practice_city", "description": "The city where the provider is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_state": {"name": "practice_state", "description": "The state where the provider is located.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_zip_code": {"name": "practice_zip_code", "description": "The zip code for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_updated": {"name": "last_updated", "description": "Date when the data for this provider was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deactivation_date": {"name": "deactivation_date", "description": "Date when this NPI was deactivated if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deactivation_flag": {"name": "deactivation_flag", "description": "Flag indicating if this NPI was deactivated.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.1302989, "relation_name": "tuva.core._stg_claims_practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\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": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["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": "\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 tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom tuva.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom tuva.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('2023-09-12 13:15:18.296145+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "tuva", "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": "ebaf2b24a87ba2bd38e9386dafca28a93e01892452fb6f63144572d6bc8de1eb"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core procedure table", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "Type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_npi": {"name": "practitioner_npi", "description": "NPI of the provider who performed the procedure.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1694466127.1073632, "relation_name": "tuva.core._stg_claims_procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the procedure table in core.\r\n-- *************************************************\r\n\r\n\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 , 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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('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 , 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('medical_claim') }} \r\nwhere procedure_code_25 is not null\r\n\r\n)\r\n\r\n\r\nselect distinct\r\n cast(null as {{ dbt.type_string() }} ) as procedure_id\r\n , cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(eg.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(case\r\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\r\n end as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(icd.icd_10_pcs as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(icd.description 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(null 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\n left join {{ ref('terminology__icd_10_pcs') }} as icd\r\n on unpivot_cte.source_code = icd.icd_10_pcs\r\n left join {{ ref('acute_inpatient__encounter_data_for_medical_claims')}} as eg\r\n on unpivot_cte.claim_id = eg.claim_id\r\n and unpivot_cte.patient_id = eg.patient_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["terminology__icd_10_pcs"], ["acute_inpatient__encounter_data_for_medical_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_procedure.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model creates the procedure table in core.\n-- *************************************************\n\n\n\n\nwith unpivot_cte as (\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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.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 , 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 tuva.claims_data_model.medical_claim \nwhere procedure_code_25 is not null\n\n)\n\n\nselect distinct\n cast(null as TEXT ) as procedure_id\n , cast(unpivot_cte.patient_id as TEXT ) as patient_id\n , cast(eg.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(case\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\n end as TEXT ) as normalized_code_type\n , cast(icd.icd_10_pcs as TEXT ) as normalized_code\n , cast(icd.description 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(null 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('2023-09-12 13:15:18.296145+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\n left join tuva.terminology.icd_10_pcs as icd\n on unpivot_cte.source_code = icd.icd_10_pcs\n left join tuva.claims_preprocessing._int_encounter_data_for_medical_claims as eg\n on unpivot_cte.claim_id = eg.claim_id\n and unpivot_cte.patient_id = eg.patient_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_condition": {"database": "tuva", "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": "1b14a0315fab4641ef2ba0c7967c6f04f6d8dd17de8bc5a09c5270e323f6bd06"}, "config": {"enabled": true, "alias": "_stg_clinical_condition", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.133353, "relation_name": "tuva.core._stg_clinical_condition", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('condition') }}", "language": "sql", "refs": [["condition"]], "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.claims_data_model.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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "tuva", "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": "20bdd56e5914b6cd6a12fc787049b4b4529aefd68a99196b607b2d8a76a40fe4"}, "config": {"enabled": true, "alias": "_stg_clinical_encounter", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.1353464, "relation_name": "tuva.core._stg_clinical_encounter", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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 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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('encounter') }}", "language": "sql", "refs": [["encounter"]], "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.claims_data_model.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 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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.encounter", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "tuva", "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": "f520c7b0ec6e048056b70e0fcd582baa66af93318b4ec74436f0497d88830965"}, "config": {"enabled": true, "alias": "_stg_clinical_lab_result", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.1379232, "relation_name": "tuva.core._stg_clinical_lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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_int() }} ) as source_abnormal_flag\r\n , cast(normalized_abnormal_flag as {{ dbt.type_int() }} ) 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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('lab_result') }}", "language": "sql", "refs": [["lab_result"]], "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.claims_data_model.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 INT ) as source_abnormal_flag\n , cast(normalized_abnormal_flag as INT ) 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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.lab_result", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_location": {"database": "tuva", "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": "71a46a3f51a8ca2f41252bd7cb70598b1f05ad410703f676cb9664f046625772"}, "config": {"enabled": true, "alias": "_stg_clinical_location", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.1409864, "relation_name": "tuva.core._stg_clinical_location", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('location') }}", "language": "sql", "refs": [["location"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.claims_data_model.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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.location", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "tuva", "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": "2ef9e0c6266330a5cad148bbec6b448e3df137bfd8e222edf752a760a73ccdb4"}, "config": {"enabled": true, "alias": "_stg_clinical_medication", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.1430006, "relation_name": "tuva.core._stg_clinical_medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('medication') }}", "language": "sql", "refs": [["medication"]], "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.claims_data_model.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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.medication", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "tuva", "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": "791d35f987484500849cde9ac1a66ca4642b7872de4fefc32b9770d2ab586962"}, "config": {"enabled": true, "alias": "_stg_clinical_observation", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.146478, "relation_name": "tuva.core._stg_clinical_observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run \r\nfrom {{ ref('observation') }}", "language": "sql", "refs": [["observation"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.claims_data_model.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(tuva_last_run as TIMESTAMP ) as tuva_last_run \nfrom tuva.claims_data_model.observation", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "tuva", "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": "7d46048fff4fda1b455277dcc846ffd738e6aaaefab7c8be4d69cae5a08bceb2"}, "config": {"enabled": true, "alias": "_stg_clinical_patient", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.14898, "relation_name": "tuva.core._stg_clinical_patient", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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(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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('patient') }}", "language": "sql", "refs": [["patient"]], "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.claims_data_model.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(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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "tuva", "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": "f3e8fadd39777bf96bdae2faa770d36952a4359c6663e09e79dc4a0adc45ea4f"}, "config": {"enabled": true, "alias": "_stg_clinical_practitioner", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.1520486, "relation_name": "tuva.core._stg_clinical_practitioner", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('practitioner') }}", "language": "sql", "refs": [["practitioner"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.claims_data_model.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(tuva_last_run as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_data_model.practitioner", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "tuva", "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": "ad7d297f7b37c61f4d0e471010157a24731118aa3e42a463399f1a3295ad05bf"}, "config": {"enabled": true, "alias": "_stg_clinical_procedure", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "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": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "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": "#0f3d0b"}}, "created_at": 1694466127.1540368, "relation_name": "tuva.core._stg_clinical_procedure", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\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(tuva_last_run as {{ dbt.type_timestamp() }} ) as tuva_last_run \r\nfrom {{ ref('procedure') }}", "language": "sql", "refs": [["procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.claims_data_model.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(tuva_last_run as TIMESTAMP ) as tuva_last_run \nfrom tuva.claims_data_model.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "tuva", "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": "5b648f138c2737595b62cfd3be5c9127040551776a7c37406f1cdfcfe84c69e8"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "The payer covering the patient's eligibility", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.158609, "relation_name": "tuva.financial_pmpm.member_months", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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() }} )\r\n ,lpad(cast(month as {{ dbt.type_string() }}),2,'0')) \r\n 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, '{{ 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": [["terminology__calendar"], ["financial_pmpm__stg_eligibility"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.eligibility\n),month_start_and_end_dates as (\nselect \n concat(cast(year as TEXT )\n ,lpad(cast(month as TEXT),2,'0')) \n as year_month\n, min(full_date) as month_start_date\n, max(full_date) as month_end_date\nfrom tuva.terminology.calendar\ngroup by 1\n)\n\nselect distinct\n a.patient_id\n, year_month\n, a.payer\n, '2023-09-12 13:15:18.296145+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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.eligibility\n)"}]}, "model.the_tuva_project.financial_pmpm__pmpm": {"database": "tuva", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm"], "alias": "pmpm", "checksum": {"name": "sha256", "checksum": "55abe9b601bb585edbeb4ed9e4abdd420700a6173b33ba755d2da9d3b68dda87"}, "config": {"enabled": true, "alias": "pmpm", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1694466127.18982, "relation_name": "tuva.financial_pmpm.pmpm", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n)}}\r\n\r\nSELECT \r\n year_month,\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", "language": "sql", "refs": [["financial_pmpm__pmpm_prep"]], "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.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\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 '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nFROM tuva.financial_pmpm.pmpm_prep a\nGROUP BY 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"database": "tuva", "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": "39fa6dabdde64ff73696abadc0645ef26490a55ac02771f671b370c24b20aac9"}, "config": {"enabled": true, "alias": "pmpm_prep", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.1740005, "relation_name": "tuva.financial_pmpm.pmpm_prep", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith combine as (\r\nSELECT\r\n a.patient_id,\r\n a.year_month,\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__stg_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\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\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\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)\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": [["financial_pmpm__stg_member_months"], ["financial_pmpm__service_category_1_paid_pivot"], ["financial_pmpm__service_category_2_paid_pivot"], ["financial_pmpm__service_category_1_allowed_pivot"], ["financial_pmpm__service_category_2_allowed_pivot"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__stg_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 __dbt__cte__financial_pmpm__stg_member_months as (\n\n\n\nSELECT\n patient_id\n, year_month\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months\n),combine as (\nSELECT\n a.patient_id,\n a.year_month,\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 __dbt__cte__financial_pmpm__stg_member_months a\nleft join tuva.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\nleft join tuva.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\nleft join tuva.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\nleft join tuva.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)\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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom combine", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_member_months", "sql": " __dbt__cte__financial_pmpm__stg_member_months as (\n\n\n\nSELECT\n patient_id\n, year_month\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months\n)"}]}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "tuva", "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": "c1d249e75f038635be99000e8c153bdf34dfb166f0b7f9e6a7373b3a67fa75d3"}, "config": {"enabled": true, "alias": "_int_patient_spend_with_service_categories", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "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": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.191789, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith claims_with_service_categories as (\r\nselect \r\n a.patient_id\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\nfrom {{ ref('financial_pmpm__stg_medical_claim') }} a\r\n)\r\n\r\n, medical_claims_year_month as (\r\nselect \r\n patient_id\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\nfrom claims_with_service_categories\r\n)\r\n\r\n, rx_claims as (\r\nselect \r\n patient_id\r\n, 'Pharmacy' as service_category_1\r\n, cast(null as {{ dbt.type_string() }}) as service_category_2\r\n, dispensing_date as claim_date\r\n, paid_amount\r\n, allowed_amount\r\nfrom {{ ref('financial_pmpm__stg_pharmacy_claim') }} \r\n)\r\n\r\n, rx_claims_year_month as (\r\nselect \r\n patient_id\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\nfrom 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, 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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine_medical_and_rx\r\ngroup by 1,2,3,4", "language": "sql", "refs": [["financial_pmpm__stg_medical_claim"], ["financial_pmpm__stg_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim\n),claims_with_service_categories as (\nselect \n a.patient_id\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\nfrom __dbt__cte__financial_pmpm__stg_medical_claim a\n)\n\n, medical_claims_year_month as (\nselect \n patient_id\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\nfrom claims_with_service_categories\n)\n\n, rx_claims as (\nselect \n patient_id\n, 'Pharmacy' as service_category_1\n, cast(null as TEXT) as service_category_2\n, dispensing_date as claim_date\n, paid_amount\n, allowed_amount\nfrom __dbt__cte__financial_pmpm__stg_pharmacy_claim \n)\n\n, rx_claims_year_month as (\nselect \n patient_id\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\nfrom 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, service_category_1\n, service_category_2\n, sum(paid_amount) as total_paid\n, sum(allowed_amount) as total_allowed\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom combine_medical_and_rx\ngroup by 1,2,3,4", "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim\n)"}]}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "tuva", "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": "10c01a7d9c381c5eec9503612a4c16bacaa20356db44adefd3382f7e56639a31"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.1964152, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_1\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_1\n, sum(total_allowed) as total_allowed\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\n patient_id\n, year_month\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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "tuva", "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": "19834ba067aaae7ba695c5213695a6e98dc2a74b2b5643c951e9557c17620e5a"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.2011535, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_1\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_1\n, sum(total_paid) as total_paid\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\n patient_id\n, year_month\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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "tuva", "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": "e602da771abe2fbe8ddc02b01897510d5ccfc98a1ae20f3ff8b87682347dc623"}, "config": {"enabled": true, "alias": "_int_service_category_2_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.1991603, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_2\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\npatient_id, \r\nyear_month, \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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_2\n, sum(total_allowed) as total_allowed\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\npatient_id, \nyear_month, \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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "tuva", "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": "b69fde7c180333a1e92d1741f4e784f3992c1870f3dc44bc0d35607d439b1ff9"}, "config": {"enabled": true, "alias": "_int_service_category_2_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.2041433, "relation_name": "tuva.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)))\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, service_category_2\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3\r\n)\r\n\r\nselect\r\npatient_id, \r\nyear_month, \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", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "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, service_category_2\n, sum(total_paid) as total_paid\nfrom tuva.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3\n)\n\nselect\npatient_id, \nyear_month, \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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "tuva", "schema": "claims_data_model", "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": "6f929aa6ba38c735e69bf9d11cee072ca99034e0c84f064a66f50580164c8a71"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.205171, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [["core__eligibility"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "tuva", "schema": "claims_data_model", "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": "c388768c61e03729cddff1584573bef76c239a66824250b2c82fc21ca646ca88"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.207712, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_member_months": {"database": "tuva", "schema": "claims_data_model", "name": "financial_pmpm__stg_member_months", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_member_months.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_member_months.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_member_months", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_member_months"], "alias": "financial_pmpm__stg_member_months", "checksum": {"name": "sha256", "checksum": "09c3df0b70f42c7ccb56bd082269d38c85ec7c0f7b315de607d70d60fd7484b9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.2109332, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n patient_id\r\n, year_month\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('financial_pmpm__member_months') }}", "language": "sql", "refs": [["financial_pmpm__member_months"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__member_months"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_member_months.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, year_month\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "tuva", "schema": "claims_data_model", "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": "30a2cc87ca3fe2978c95d27531c380940217b319465b4a4e003a2fc137445351"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "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": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "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": "#abab26"}}, "created_at": 1694466127.2087827, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [["core__pharmacy_claim"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__summary_counts": {"database": "tuva", "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": "44f8fc54e84999f685b0320cb9679e8fbf0afbbd68006d59b8188f732c90def4"}, "config": {"enabled": true, "alias": "summary_counts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "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, "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, "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, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2185988, "relation_name": "tuva.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))))\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 from {{ ref('quality_measures__summary_long') }}\r\n where measure_id is not null\r\n\r\n)\r\n\r\n, sum_flags 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 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, 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 , denominator_sum\r\n , numerator_sum\r\n , exclusion_sum\r\n , (\r\n cast(numerator_sum as {{ dbt.type_numeric() }}) /\r\n (cast(denominator_sum as {{ dbt.type_numeric() }}) - cast(exclusion_sum as {{ dbt.type_numeric() }}))\r\n )*100 as performance_rate\r\n from sum_flags\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": [["quality_measures__summary_long"]], "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 from tuva.quality_measures.summary_long\n where measure_id is not null\n\n)\n\n, sum_flags 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 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, 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 , denominator_sum\n , numerator_sum\n , exclusion_sum\n , (\n cast(numerator_sum as numeric(28,6)) /\n (cast(denominator_sum as numeric(28,6)) - cast(exclusion_sum as numeric(28,6)))\n )*100 as performance_rate\n from sum_flags\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__summary_long": {"database": "tuva", "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": "946b1357bb239007359a80daee0ea150bc6a99064aeccda80f796fa89558cd8c"}, "config": {"enabled": true, "alias": "summary_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2236664, "relation_name": "tuva.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))))\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\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 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 , 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__int_nqf2372_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_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 tuva.quality_measures._int_nqf2372_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(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 , 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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__summary_wide": {"database": "tuva", "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": "cea721077d639800527de810f314ea61bd0b252d32af4050651400580ca2fd30"}, "config": {"enabled": true, "alias": "summary_wide", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "Each measure has a boolean flag which is the result of evaluating the denominator, numerator, and exclusion indicators for the patient. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2281473, "relation_name": "tuva.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))))\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 , 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 , case\r\n when denominator_flag = 1\r\n then\r\n case\r\n when exclusion_flag = 1 then null\r\n when exclusion_flag = 0 then numerator_flag\r\n else null\r\n end\r\n end as flag\r\n from measures_long\r\n where measure_id = 'NQF2372'\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.flag as nqf_2372\r\n from measures_long\r\n left join nqf_2372\r\n on measures_long.patient_id = nqf_2372.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 from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , nqf_2372\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__summary_long"]], "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 , measure_id\n from tuva.quality_measures.summary_long\n\n)\n\n, nqf_2372 as (\n\n select\n patient_id\n , case\n when denominator_flag = 1\n then\n case\n when exclusion_flag = 1 then null\n when exclusion_flag = 0 then numerator_flag\n else null\n end\n end as flag\n from measures_long\n where measure_id = 'NQF2372'\n\n)\n\n, joined as (\n\n select\n measures_long.patient_id\n , nqf_2372.flag as nqf_2372\n from measures_long\n left join nqf_2372\n on measures_long.patient_id = nqf_2372.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 from joined\n\n)\n\nselect\n patient_id\n , nqf_2372\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_denominator"], "alias": "_int_nqf2372_denominator", "checksum": {"name": "sha256", "checksum": "f4f5dc2175e2fba26fc136910a4b84e52c0de7e1cd9ceb34bd482724d97a49ba"}, "config": {"enabled": true, "alias": "_int_nqf2372_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2364311, "relation_name": "tuva.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))))\r\n )\r\n}}\r\n{%- set performance_period_end = var('quality_measures_period_end') -%}\r\n\r\n{%- set performance_period_begin -%}\r\n{{ dbt.dateadd(datepart=\"month\", interval=-27, from_date_or_timestamp=\"'\"~performance_period_end~\"'\") }}\r\n{%- endset -%}\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\nwith patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\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 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_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , performance_period_begin\r\n , performance_period_end\r\n , floor({{ datediff('birth_date', 'performance_period_begin', 'hour') }} / 8766.0) as age\r\n from patient\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 , performance_period_begin\r\n , performance_period_end\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) = 'office visit'\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.performance_period_begin\r\n , patient_filtered.performance_period_end\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({{ 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 , 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": [["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__stg_core__patient"], ["quality_measures__stg_core__encounter"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"], ["quality_measures__value_sets"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time", "macro.dbt.dateadd", "macro.dbt.datediff", "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__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\\quality_measures__int_nqf2372_denominator.sql", "compiled": true, "compiled_code": "with __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n), __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , death_date\n , cast(\n\n dateadd(\n month,\n -27,\n '2023-09-12'\n )\n\n as date) as performance_period_begin\n , cast('2023-09-12'as date) as performance_period_end\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 tuva.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_id\n , sex\n , birth_date\n , death_date\n , performance_period_begin\n , performance_period_end\n , floor(datediff(\n hour,\n birth_date,\n performance_period_begin\n ) / 8766.0) as age\n from patient\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 , performance_period_begin\n , performance_period_end\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) = 'office visit'\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.performance_period_begin\n , patient_filtered.performance_period_end\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((select id\nfrom tuva.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_id\n , cast((select name\nfrom tuva.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_name\n , cast((select version\nfrom tuva.quality_measures._value_set_measures\nwhere id = 'NQF2372') 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 , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_advanced_illness", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_advanced_illness.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_advanced_illness.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_exclude_advanced_illness"], "alias": "_int_nqf2372_exclude_advanced_illness", "checksum": {"name": "sha256", "checksum": "935d5a66dd1fe1df51f0e76e903313fba5150ae1e0f1148b1a37b70827efd3b8"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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_advanced_illness", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466127.2414367, "relation_name": "tuva.quality_measures._int_nqf2372_exclude_advanced_illness", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n\r\n AND either one acute inpatient encounter with a diagnosis of advanced\r\n illness\r\n\r\n OR two outpatient, observation, ED or nonacute inpatient encounters on\r\n different dates of service with an advanced illness diagnosis during\r\n measurement period or the year prior to measurement period\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_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 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\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, 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\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\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/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n*/\r\n, patients_with_frailty 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 from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n where denominator.age >= 66\r\n and condition_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and condition_exclusions.recorded_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where denominator.age >= 66\r\n and med_claim_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n where denominator.age >= 66\r\n and observation_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and observation_exclusions.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n where denominator.age >= 66\r\n and procedure_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n)\r\n\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n\r\n AND one acute inpatient encounter with a diagnosis of advanced illness\r\n during measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\r\n || ' with '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\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 med_claim_exclusions.concept_name = 'Acute Inpatient'\r\n and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from patients_with_frailty\r\n inner join observation_exclusions\r\n on patients_with_frailty.patient_id = observation_exclusions.patient_id\r\n where observation_exclusions.concept_name = 'Acute Inpatient'\r\n and (\r\n observation_exclusions.observation_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\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 , procedure_exclusions.concept_name as exclusion_reason\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 procedure_exclusions.concept_name = 'Acute Inpatient'\r\n and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n procedure_exclusions.procedure_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n)\r\n\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for\r\n frailty during the measurement period\r\n\r\n AND two outpatient, observation, ED or nonacute inpatient encounters\r\n on different dates of service with an advanced illness diagnosis during\r\n measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\r\n || ' with '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\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 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 and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from patients_with_frailty\r\n inner join observation_exclusions\r\n on patients_with_frailty.patient_id = observation_exclusions.patient_id\r\n where observation_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 and (\r\n observation_exclusions.observation_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\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 , procedure_exclusions.concept_name as exclusion_reason\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 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 and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n procedure_exclusions.procedure_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n)\r\n\r\n/*\r\n Filter to patients who have had one acute inpatient encounter or\r\n two nonacute outpatient encounters\r\n*/\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , count(*) as encounter_count\r\n from acute_inpatient\r\n group by patient_id\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , count(*) as encounter_count\r\n from nonacute_outpatient\r\n group by patient_id\r\n\r\n)\r\n\r\n, eligible_acute_inpatient 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 from acute_inpatient\r\n left join acute_inpatient_counts\r\n on acute_inpatient.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n)\r\n\r\n, eligible_nonacute_outpatient as (\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 from nonacute_outpatient\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n eligible_acute_inpatient.patient_id\r\n , eligible_acute_inpatient.exclusion_date\r\n , eligible_acute_inpatient.exclusion_reason\r\n from eligible_acute_inpatient\r\n\r\n union all\r\n\r\n select\r\n eligible_nonacute_outpatient.patient_id\r\n , eligible_nonacute_outpatient.exclusion_date\r\n , eligible_nonacute_outpatient.exclusion_reason\r\n from eligible_nonacute_outpatient\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 exclusions_unioned", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "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_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\\quality_measures__int_nqf2372_exclude_advanced_illness.sql", "compiled": true, "compiled_code": "\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n\n AND either one acute inpatient encounter with a diagnosis of advanced\n illness\n\n OR two outpatient, observation, ED or nonacute inpatient encounters on\n different dates of service with an advanced illness diagnosis during\n measurement period or the year prior to measurement period\n*/\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from tuva.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 tuva.quality_measures._value_set_codes\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\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, 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\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\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/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n*/\n, patients_with_frailty as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n where denominator.age >= 66\n and condition_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and condition_exclusions.recorded_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where denominator.age >= 66\n and med_claim_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join observation_exclusions\n on denominator.patient_id = observation_exclusions.patient_id\n where denominator.age >= 66\n and observation_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and observation_exclusions.observation_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n where denominator.age >= 66\n and procedure_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n)\n\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n\n AND one acute inpatient encounter with a diagnosis of advanced illness\n during measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\n || ' with '\n || condition_exclusions.concept_name\n as exclusion_reason\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 med_claim_exclusions.concept_name = 'Acute Inpatient'\n and condition_exclusions.concept_name = 'Advanced Illness'\n and (\n med_claim_exclusions.claim_start_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n or med_claim_exclusions.claim_end_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from patients_with_frailty\n inner join observation_exclusions\n on patients_with_frailty.patient_id = observation_exclusions.patient_id\n where observation_exclusions.concept_name = 'Acute Inpatient'\n and (\n observation_exclusions.observation_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\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 procedure_exclusions.concept_name = 'Acute Inpatient'\n and condition_exclusions.concept_name = 'Advanced Illness'\n and (\n procedure_exclusions.procedure_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n)\n\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for\n frailty during the measurement period\n\n AND two outpatient, observation, ED or nonacute inpatient encounters\n on different dates of service with an advanced illness diagnosis during\n measurement period or the year prior to measurement period\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 , med_claim_exclusions.concept_name\n || ' with '\n || condition_exclusions.concept_name\n as exclusion_reason\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 med_claim_exclusions.concept_name in (\n 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n and condition_exclusions.concept_name = 'Advanced Illness'\n and (\n med_claim_exclusions.claim_start_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n or med_claim_exclusions.claim_end_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from patients_with_frailty\n inner join observation_exclusions\n on patients_with_frailty.patient_id = observation_exclusions.patient_id\n where observation_exclusions.concept_name in (\n 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n and (\n observation_exclusions.observation_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\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 procedure_exclusions.concept_name in (\n 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n and condition_exclusions.concept_name = 'Advanced Illness'\n and (\n procedure_exclusions.procedure_date\n between \n\n dateadd(\n year,\n -1,\n patients_with_frailty.performance_period_begin\n )\n\n\n and patients_with_frailty.performance_period_end\n )\n\n)\n\n/*\n Filter to patients who have had one acute inpatient encounter or\n two nonacute outpatient encounters\n*/\n, acute_inpatient_counts as (\n\n select\n patient_id\n , count(*) as encounter_count\n from acute_inpatient\n group by patient_id\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , count(*) as encounter_count\n from nonacute_outpatient\n group by patient_id\n\n)\n\n, eligible_acute_inpatient as (\n\n select\n acute_inpatient.patient_id\n , acute_inpatient.exclusion_date\n , acute_inpatient.exclusion_reason\n from acute_inpatient\n left join acute_inpatient_counts\n on acute_inpatient.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n)\n\n, eligible_nonacute_outpatient as (\n\n select\n nonacute_outpatient.patient_id\n , nonacute_outpatient.exclusion_date\n , nonacute_outpatient.exclusion_reason\n from nonacute_outpatient\n left join nonacute_outpatient_counts\n on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n)\n\n, exclusions_unioned as (\n\n select\n eligible_acute_inpatient.patient_id\n , eligible_acute_inpatient.exclusion_date\n , eligible_acute_inpatient.exclusion_reason\n from eligible_acute_inpatient\n\n union all\n\n select\n eligible_nonacute_outpatient.patient_id\n , eligible_nonacute_outpatient.exclusion_date\n , eligible_nonacute_outpatient.exclusion_reason\n from eligible_nonacute_outpatient\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-09-12 13:15:18.296145+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 , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_dementia", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_dementia.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_dementia.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_exclude_dementia"], "alias": "_int_nqf2372_exclude_dementia", "checksum": {"name": "sha256", "checksum": "09b7d68474d7a13279ffbfdd15ff9cba969282d8a917e5e4b1f66463ea23540d"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and taking dementia medications 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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_dementia", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466127.2459404, "relation_name": "tuva.quality_measures._int_nqf2372_exclude_dementia", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Patients greater than or equal to 66 with at least one claim/encounter for frailty\r\n during the measurement period AND a dispensed medication for dementia during the measurement period\r\n or year prior to measurement period\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_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 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n , 'Dementia Medications'\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, 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, 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, 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, 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, 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, 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, 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, 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 denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , condition_exclusions.recorded_date as exclusion_date\r\n , condition_exclusions.concept_name\r\n from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n where denominator.age >= 66\r\n and condition_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and condition_exclusions.recorded_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\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\r\n from denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where denominator.age >= 66\r\n and med_claim_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n where denominator.age >= 66\r\n and observation_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and observation_exclusions.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n where denominator.age >= 66\r\n and procedure_exclusions.concept_name in (\r\n 'Frailty Device'\r\n , 'Frailty Diagnosis'\r\n , 'Frailty Encounter'\r\n , 'Frailty Symptom'\r\n )\r\n and procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\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.concept_name\r\n || ' with '\r\n || pharmacy_claim_exclusions.concept_name\r\n as exclusion_reason\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 where (\r\n pharmacy_claim_exclusions.dispensing_date\r\n between patients_with_frailty.performance_period_begin\r\n and patients_with_frailty.performance_period_end\r\n or pharmacy_claim_exclusions.paid_date\r\n between patients_with_frailty.performance_period_begin\r\n and patients_with_frailty.performance_period_end\r\n )\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.concept_name\r\n || ' with '\r\n || medication_exclusions.concept_name\r\n as exclusion_reason\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 where medication_exclusions.dispensing_date\r\n between patients_with_frailty.performance_period_begin\r\n and patients_with_frailty.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 , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom frailty_with_dementia", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__medication"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_pharmacy_claim"], ["quality_measures__stg_core__procedure"]], "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_medical_claim", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_dementia.sql", "compiled": true, "compiled_code": "\n\n/*\n Patients greater than or equal to 66 with at least one claim/encounter for frailty\n during the measurement period AND a dispensed medication for dementia during the measurement period\n or year prior to measurement period\n*/\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from tuva.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 tuva.quality_measures._value_set_codes\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n , 'Dementia Medications'\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, 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, 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, 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, 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, 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, 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, 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, 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 denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n where denominator.age >= 66\n and condition_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and condition_exclusions.recorded_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\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\n from denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where denominator.age >= 66\n and med_claim_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name\n from denominator\n inner join observation_exclusions\n on denominator.patient_id = observation_exclusions.patient_id\n where denominator.age >= 66\n and observation_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and observation_exclusions.observation_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n where denominator.age >= 66\n and procedure_exclusions.concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n and procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\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.concept_name\n || ' with '\n || pharmacy_claim_exclusions.concept_name\n as exclusion_reason\n from patients_with_frailty\n inner join pharmacy_claim_exclusions\n on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id\n where (\n pharmacy_claim_exclusions.dispensing_date\n between patients_with_frailty.performance_period_begin\n and patients_with_frailty.performance_period_end\n or pharmacy_claim_exclusions.paid_date\n between patients_with_frailty.performance_period_begin\n and patients_with_frailty.performance_period_end\n )\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.concept_name\n || ' with '\n || medication_exclusions.concept_name\n as exclusion_reason\n from patients_with_frailty\n inner join medication_exclusions\n on patients_with_frailty.patient_id = medication_exclusions.patient_id\n where medication_exclusions.dispensing_date\n between patients_with_frailty.performance_period_begin\n and patients_with_frailty.performance_period_end\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-09-12 13:15:18.296145+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__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_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 , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.medication\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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_hospice", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_hospice.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_hospice.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_exclude_hospice"], "alias": "_int_nqf2372_exclude_hospice", "checksum": {"name": "sha256", "checksum": "c365583052dce282be4b21ed1542a4bb03b8c0f456c860dfd76cefb605053075"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_hospice", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using hospice services 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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_hospice", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466127.2495575, "relation_name": "tuva.quality_measures._int_nqf2372_exclude_hospice", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Hospice services used by patient any time during the measurement period\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 'Hospice Care Ambulatory'\r\n , 'Hospice Encounter'\r\n )\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, 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, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\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, 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, 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.normalized_code = exclusion_codes.code\r\n and procedures.normalized_code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, hospice as (\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 where observation_exclusions.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.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 denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\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 where procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.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 , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom hospice", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"]], "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__observation", "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\\quality_measures__int_nqf2372_exclude_hospice.sql", "compiled": true, "compiled_code": "\n\n/*\n Hospice services used by patient any time during the measurement period\n*/\n\nwith __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from tuva.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 tuva.quality_measures._value_set_codes\n where concept_name in (\n 'Hospice Care Ambulatory'\n , 'Hospice Encounter'\n )\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, 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, procedures as (\n\n select\n patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n from __dbt__cte__quality_measures__stg_core__procedure\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, 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, 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.normalized_code = exclusion_codes.code\n and procedures.normalized_code_type = exclusion_codes.code_system\n\n)\n\n, hospice as (\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 where observation_exclusions.observation_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n union all\n\n select\n denominator.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 denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\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 where procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom hospice", "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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_institutional.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_institutional.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_exclude_institutional"], "alias": "_int_nqf2372_exclude_institutional", "checksum": {"name": "sha256", "checksum": "93785cc031729a541dbb40caf801559a4408be7dbcb5c6e5824263ee557cd4da"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_institutional", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients staying in an institution 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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_institutional", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466127.253544, "relation_name": "tuva.quality_measures._int_nqf2372_exclude_institutional", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Patients greater than or equal to 66 in Institutional Special Needs Plans (SNP)\r\n or residing in long term care\r\n\r\n Future enhancement: group claims into encounters\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_nqf2372_denominator') }}\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 denominator.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 denominator\r\n inner join medical_claim\r\n on denominator.patient_id = medical_claim.patient_id\r\n where denominator.age >= 66\r\n and (\r\n medical_claim.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or medical_claim.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n and 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_institutional.sql", "compiled": true, "compiled_code": "\n\n/*\n Patients greater than or equal to 66 in Institutional Special Needs Plans (SNP)\n or residing in long term care\n\n Future enhancement: group claims into encounters\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from tuva.quality_measures._int_nqf2372_denominator\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 denominator.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 denominator\n inner join medical_claim\n on denominator.patient_id = medical_claim.patient_id\n where denominator.age >= 66\n and (\n medical_claim.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or medical_claim.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\n and 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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom exclusions", "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_mastectomy", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "original_file_path": "models\\quality_measures\\intermediate\\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", "quality_measures__int_nqf2372_exclude_mastectomy"], "alias": "_int_nqf2372_exclude_mastectomy", "checksum": {"name": "sha256", "checksum": "e3ecfede0fbbcab122719d0c067345956be75848f0d315d00403410b9a73b800"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_mastectomy", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2571073, "relation_name": "tuva.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))))\r\n )\r\n}}\r\n\r\n/*\r\n Patients that had a mastectomy performed or who have a history of 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, 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\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 mastectomy", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "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\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "compiled": true, "compiled_code": "\n\n/*\n Patients that had a mastectomy performed or who have a history of mastectomy\n*/\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from tuva.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 tuva.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, 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\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom mastectomy", "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 , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_palliative", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_palliative.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclude_palliative.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_exclude_palliative"], "alias": "_int_nqf2372_exclude_palliative", "checksum": {"name": "sha256", "checksum": "93ff2352e6d99a84d4446780ab1398bb344392449826863d970661aabeb95044"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using palliative services 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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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_palliative", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1694466127.260729, "relation_name": "tuva.quality_measures._int_nqf2372_exclude_palliative", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Palliative care services used by patient any time during the measurement period\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 'Palliative Care Encounter'\r\n , 'Palliative Care Intervention'\r\n )\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, 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, palliative_care as (\r\n\r\n select\r\n denominator.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 denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\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 where observation_exclusions.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\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 where procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.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 , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom palliative_care", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "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_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\\quality_measures__int_nqf2372_exclude_palliative.sql", "compiled": true, "compiled_code": "\n\n/*\n Palliative care services used by patient any time during the measurement period\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from tuva.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 tuva.quality_measures._value_set_codes\n where concept_name in (\n 'Palliative Care Encounter'\n , 'Palliative Care Intervention'\n )\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, 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, palliative_care as (\n\n select\n denominator.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 denominator\n inner join med_claim_exclusions\n on denominator.patient_id = med_claim_exclusions.patient_id\n where (\n med_claim_exclusions.claim_start_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n or med_claim_exclusions.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n )\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 where observation_exclusions.observation_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\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 where procedure_exclusions.procedure_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom palliative_care", "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_exclusions"], "alias": "_int_nqf2372_exclusions", "checksum": {"name": "sha256", "checksum": "122797297c958130e18fc97373ccc56d2df7be6c71f8007a047601b4c3c33c64"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2654574, "relation_name": "tuva.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))))\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 , 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, advanced_illness 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_advanced_illness') }}\r\n\r\n)\r\n\r\n, dementia 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_dementia') }}\r\n\r\n)\r\n\r\n, hospice 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_hospice') }}\r\n\r\n)\r\n\r\n, institutional 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_institutional') }}\r\n\r\n)\r\n\r\n, mastectomy 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\r\n, palliative 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_palliative') }}\r\n\r\n)\r\n\r\n, denominator_with_advanced_illness 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when advanced_illness.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , advanced_illness.exclusion_date\r\n , advanced_illness.exclusion_reason\r\n from denominator\r\n left join advanced_illness\r\n on denominator.patient_id = advanced_illness.patient_id\r\n\r\n)\r\n\r\n, denominator_with_dementia 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when dementia.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , dementia.exclusion_date\r\n , dementia.exclusion_reason\r\n from denominator\r\n left join dementia\r\n on denominator.patient_id = dementia.patient_id\r\n\r\n)\r\n\r\n, denominator_with_hospice 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when hospice.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , hospice.exclusion_date\r\n , hospice.exclusion_reason\r\n from denominator\r\n left join hospice\r\n on denominator.patient_id = hospice.patient_id\r\n\r\n)\r\n\r\n, denominator_with_institutional 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when institutional.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , institutional.exclusion_date\r\n , institutional.exclusion_reason\r\n from denominator\r\n left join institutional\r\n on denominator.patient_id = institutional.patient_id\r\n\r\n)\r\n\r\n, denominator_with_mastectomy 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when mastectomy.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , mastectomy.exclusion_date\r\n , mastectomy.exclusion_reason\r\n from denominator\r\n left join mastectomy\r\n on denominator.patient_id = mastectomy.patient_id\r\n\r\n)\r\n\r\n, denominator_with_palliative 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.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when palliative.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , palliative.exclusion_date\r\n , palliative.exclusion_reason\r\n from denominator\r\n left join palliative\r\n on denominator.patient_id = palliative.patient_id\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select * from denominator_with_advanced_illness\r\n union all\r\n select * from denominator_with_dementia\r\n union all\r\n select * from denominator_with_hospice\r\n union all\r\n select * from denominator_with_institutional\r\n union all\r\n select * from denominator_with_mastectomy\r\n union all\r\n select * from denominator_with_palliative\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(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(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n from exclusions_unioned\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 , 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": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__int_nqf2372_exclude_advanced_illness"], ["quality_measures__int_nqf2372_exclude_dementia"], ["quality_measures__int_nqf2372_exclude_hospice"], ["quality_measures__int_nqf2372_exclude_institutional"], ["quality_measures__int_nqf2372_exclude_mastectomy"], ["quality_measures__int_nqf2372_exclude_palliative"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_exclusions.sql", "compiled": true, "compiled_code": "\n\n/*\n Eligible population from the denominator model before exclusions\n*/\nwith 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 tuva.quality_measures._int_nqf2372_denominator\n\n)\n\n, advanced_illness as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures._int_nqf2372_exclude_advanced_illness\n\n)\n\n, dementia as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures._int_nqf2372_exclude_dementia\n\n)\n\n, hospice as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures._int_nqf2372_exclude_hospice\n\n)\n\n, institutional as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures._int_nqf2372_exclude_institutional\n\n)\n\n, mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures._int_nqf2372_exclude_mastectomy\n\n)\n\n, palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from tuva.quality_measures._int_nqf2372_exclude_palliative\n\n)\n\n, denominator_with_advanced_illness as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when advanced_illness.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , advanced_illness.exclusion_date\n , advanced_illness.exclusion_reason\n from denominator\n left join advanced_illness\n on denominator.patient_id = advanced_illness.patient_id\n\n)\n\n, denominator_with_dementia as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when dementia.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , dementia.exclusion_date\n , dementia.exclusion_reason\n from denominator\n left join dementia\n on denominator.patient_id = dementia.patient_id\n\n)\n\n, denominator_with_hospice as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when hospice.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , hospice.exclusion_date\n , hospice.exclusion_reason\n from denominator\n left join hospice\n on denominator.patient_id = hospice.patient_id\n\n)\n\n, denominator_with_institutional as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when institutional.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , institutional.exclusion_date\n , institutional.exclusion_reason\n from denominator\n left join institutional\n on denominator.patient_id = institutional.patient_id\n\n)\n\n, denominator_with_mastectomy as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when mastectomy.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , mastectomy.exclusion_date\n , mastectomy.exclusion_reason\n from denominator\n left join mastectomy\n on denominator.patient_id = mastectomy.patient_id\n\n)\n\n, denominator_with_palliative as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when palliative.patient_id is not null then 1\n else 0\n end as exclusion_flag\n , palliative.exclusion_date\n , palliative.exclusion_reason\n from denominator\n left join palliative\n on denominator.patient_id = palliative.patient_id\n\n)\n\n, exclusions_unioned as (\n\n select * from denominator_with_advanced_illness\n union all\n select * from denominator_with_dementia\n union all\n select * from denominator_with_hospice\n union all\n select * from denominator_with_institutional\n union all\n select * from denominator_with_mastectomy\n union all\n select * from denominator_with_palliative\n\n)\n\n, add_data_types as (\n\n select\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(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(exclusion_flag as integer) as exclusion_flag\n from exclusions_unioned\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 , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_long"], "alias": "_int_nqf2372_long", "checksum": {"name": "sha256", "checksum": "07b5be0a285c46fb425c0cf8550891c9ca5757e371d17c0891a3ec11c5d7213a"}, "config": {"enabled": true, "alias": "_int_nqf2372_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2710423, "relation_name": "tuva.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))))\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 , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\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 , 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": [["quality_measures__stg_core__patient"], ["quality_measures__int_nqf2372_denominator"], ["quality_measures__int_nqf2372_numerator"], ["quality_measures__int_nqf2372_exclusions"]], "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\\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 tuva.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 tuva.quality_measures._int_nqf2372_numerator\n\n)\n\n, exclusions 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 , exclusion_date\n , exclusion_reason\n , exclusion_flag\n from tuva.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 , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"database": "tuva", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\quality_measures__int_nqf2372_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\quality_measures__int_nqf2372_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "quality_measures__int_nqf2372_numerator"], "alias": "_int_nqf2372_numerator", "checksum": {"name": "sha256", "checksum": "93879386872c726f542d8b7cd5001e8a9d00baa2e196990a95cef7d1ab7d0039"}, "config": {"enabled": true, "alias": "_int_nqf2372_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2750056, "relation_name": "tuva.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))))\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 , 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.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_begin\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_begin\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_begin\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_begin\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_begin\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_begin\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_begin\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": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "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\\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 tuva.quality_measures._int_nqf2372_denominator\n\n)\n\n, mammography_codes as (\n\n select\n code\n , code_system\n from tuva.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.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_begin\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_begin\n and denominator.performance_period_end\n then qualifying_claims.claim_end_date\n when qualifying_observations.observation_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n then qualifying_observations.observation_date\n when qualifying_procedures.procedure_date\n between denominator.performance_period_begin\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_begin\n and denominator.performance_period_end\n then 1\n when qualifying_claims.claim_end_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n then 1\n when qualifying_observations.observation_date\n between denominator.performance_period_begin\n and denominator.performance_period_end\n then 1\n when qualifying_procedures.procedure_date\n between denominator.performance_period_begin\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 , '2023-09-12 13:15:18.296145+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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__stg_core__condition": {"database": "tuva", "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": "56563c7ec7ef01998a0ba50a2886f4e41e6f5027d977ec189a09fdfb4c1d3577"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2801108, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , claim_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": [["core__condition"]], "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 , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"database": "tuva", "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": "17e7cbfc52695e3bd73821d4e66d41660a4a92a253c468531dd55adf1e0108b0"}, "config": {"enabled": true, "alias": "_stg_encounter", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2841697, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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_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_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_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": [["core__encounter"]], "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_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.encounter\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__medication": {"database": "tuva", "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": "a4d8facab65414c5cedb3757f57d7536c76cdef9618c72767e91911af7446a28"}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2871585, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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 , 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 , 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 , {{ 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": [["core__medication"]], "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 , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__observation": {"database": "tuva", "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": "4b7ac2bebd61ab24034b2c12dc9ea7aa21e3da982ca97f2f32cb5a177e393ccb"}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.2914963, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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 , 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__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 , 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__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 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": [["core__observation"]], "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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__patient": {"database": "tuva", "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": "d5cf9006ec36a943ce06e8aaee881b3a0680f553d457ea3dcbab9697347fab8e"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.29608, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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": [["core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"database": "tuva", "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": "e3b00d13527fad61b98f018c4b996e7b03d6c34286dae32fe30aeca261c3e1f5"}, "config": {"enabled": true, "alias": "_stg_procedure", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.300821, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n patient_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": [["core__procedure"]], "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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"database": "tuva", "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": "5884cb4604fba136d994a53c922168d67f6e631365065989f3dba82334ae742f"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medical claims from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.3047245, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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('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('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": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"database": "tuva", "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": "d49fc69e28f76402bc135be0986b818fe6c8791e06f6f32bf900616e683c5bea"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "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}, "created_at": 1694466127.3082395, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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('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('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": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.claims_data_model.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "tuva", "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": "1e008007367bfa606c545d2f9b247c49fe42009d71bb535307b87927c41a9892"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "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", "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", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3385184, "relation_name": "tuva.readmissions.encounter_augmented", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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.total_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.multiple_primary_diagnoses_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": [["readmissions__encounter"], ["readmissions__index_admission"], ["readmissions__planned_encounter"], ["readmissions__encounter_specialty_cohort"], ["readmissions__encounter_data_quality"]], "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.total_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.multiple_primary_diagnoses_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 '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom\n tuva.readmissions._int_encounter aa\n left join tuva.readmissions._int_index_admission bb\n on aa.encounter_id = bb.encounter_id\n left join tuva.readmissions._int_planned_encounter cc\n on aa.encounter_id = cc.encounter_id \n left join tuva.readmissions._int_encounter_specialty_cohort dd\n on aa.encounter_id = dd.encounter_id\n left join tuva.readmissions._int_encounter_data_quality ee\n on aa.encounter_id = ee.encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__readmission_summary": {"database": "tuva", "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": "8e856a742039f7904dcb3753683a0de320d01723cd587184551051ed3f20a318"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "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", "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", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "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", "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", "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", "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", "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "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": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "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", "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", "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "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", "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3536706, "relation_name": "tuva.readmissions.readmission_summary", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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.total_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": [["readmissions__encounter_augmented"]], "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 tuva.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.total_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 '2023-09-12 13:15:18.296145+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": []}, "model.the_tuva_project.readmissions__diagnosis": {"database": "tuva", "schema": "readmissions", "name": "readmissions__diagnosis", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__diagnosis.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__diagnosis.sql", "unique_id": "model.the_tuva_project.readmissions__diagnosis", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__diagnosis"], "alias": "_int_stg_diagnosis", "checksum": {"name": "sha256", "checksum": "6616afb445f138247baa4d5238083b78ecf192b1483d27a473f6d78d4d14cda9"}, "config": {"enabled": true, "alias": "_int_stg_diagnosis", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique diagnosis a patient got in an encouter. All diagnoses available in the input data set are present here.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_stg_diagnosis", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1694466127.4036613, "relation_name": "tuva.readmissions._int_stg_diagnosis", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Staging model for the input layer:\r\n-- stg_diagnosis input layer model.\r\n-- This contains one row for every unique diagnosis each patient has.\r\n\r\nselect distinct\r\n cast(a.encounter_id as {{ dbt.type_string() }}) as encounter_id\r\n, cast(a.normalized_code as {{ dbt.type_string() }}) as diagnosis_code\r\n, cast(a.condition_rank as integer) as diagnosis_rank\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__condition') }} a\r\ninner join {{ ref('readmissions__stg_core__encounter') }} b\r\n on a.encounter_id = b.encounter_id\r\nwhere normalized_code_type = 'icd-10-cm'", "language": "sql", "refs": [["readmissions__stg_core__condition"], ["readmissions__stg_core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__diagnosis.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__condition as (\n\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n), __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 as total_paid_amount,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)-- Staging model for the input layer:\n-- stg_diagnosis input layer model.\n-- This contains one row for every unique diagnosis each patient has.\n\nselect distinct\n cast(a.encounter_id as TEXT) as encounter_id\n, cast(a.normalized_code as TEXT) as diagnosis_code\n, cast(a.condition_rank as integer) as diagnosis_rank\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom __dbt__cte__readmissions__stg_core__condition a\ninner join __dbt__cte__readmissions__stg_core__encounter b\n on a.encounter_id = b.encounter_id\nwhere normalized_code_type = 'icd-10-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__condition", "sql": " __dbt__cte__readmissions__stg_core__condition as (\n\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}, {"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 as total_paid_amount,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}]}, "model.the_tuva_project.readmissions__diagnosis_ccs": {"database": "tuva", "schema": "readmissions", "name": "readmissions__diagnosis_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__diagnosis_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__diagnosis_ccs"], "alias": "_int_diagnosis_ccs", "checksum": {"name": "sha256", "checksum": "244ef52041a36c41a42e70b4634f837ad5962cdba7cb6b29b85e6e1130dcd0bf"}, "config": {"enabled": true, "alias": "_int_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounter_ids from the stg_diagnosis table that have one and only one primary diagnosis code associated with them. There is one row for each of these encounters, namely, the row corresponding to the unique primary diagnosis code of the encounter. Therefore, the number of rows in this model is equal to the number of encounter_ids in the stg_diagnosis model that have one and only one primary diagnosis code. We add a valid_icd_10_cm_flag to indicate if the primary diagnosis code for the encounter is a valid ICD-10-CM code. We also add the CCS diagnosis category associated with the primary diagnosis code of the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "valid_icd_10_cm_flag": {"name": "valid_icd_10_cm_flag", "description": "A flag indicating if the ICD-10-CM diagnosis code given is valid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccs_diagnosis_category": {"name": "ccs_diagnosis_category", "description": "The CCS code associated with the given ICD-10-CM diagnosis", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_diagnosis_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1694466127.3573122, "relation_name": "tuva.readmissions._int_diagnosis_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we take all rows from the stg_diagnosis\r\n-- table that correspond to encounters with\r\n-- one and only one primary diagnosis code.\r\n-- To each of these rows we also append:\r\n--\r\n-- - a 'valid_icd_10_cm_flag' to verify if it is a\r\n-- valid ICD-10-CM code\r\n--\r\n-- - a 'ccs_diagnosis_category' column to indicate\r\n-- the associated diagnosis category\r\n--\r\n-- encounter_ids that have no primary diagnosis or\r\n-- multiple primary diagnoses are not part of this model\r\n-- because it is impossible to assign a ccs_diagnosis_category\r\n-- to them. In theory, each encounter should have a unique\r\n-- ccs_diagnosis_category that is determined by their unique\r\n-- primary diagnosis ICD-10-CM code.\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.diagnosis_code,\r\n aa.diagnosis_rank,\r\n case\r\n when bb.icd_10_cm is null then 0\r\n\telse 1\r\n end as valid_icd_10_cm_flag,\r\n cc.ccs_diagnosis_category,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__diagnosis') }} aa\r\n left join {{ ref('terminology__icd_10_cm') }} bb\r\n on aa.diagnosis_code = bb.icd_10_cm\r\n left join {{ ref('readmissions__icd_10_cm_to_ccs') }} cc\r\n on aa.diagnosis_code = cc.icd_10_cm\r\n left join {{ ref('readmissions__primary_diagnosis_count') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n\r\nwhere\r\n aa.diagnosis_rank = 1\r\n and\r\n dd.primary_dx_count = 1", "language": "sql", "refs": [["readmissions__diagnosis"], ["terminology__icd_10_cm"], ["readmissions__icd_10_cm_to_ccs"], ["readmissions__primary_diagnosis_count"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__diagnosis", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "model.the_tuva_project.readmissions__primary_diagnosis_count"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__diagnosis_ccs.sql", "compiled": true, "compiled_code": "\n\n-- Here we take all rows from the stg_diagnosis\n-- table that correspond to encounters with\n-- one and only one primary diagnosis code.\n-- To each of these rows we also append:\n--\n-- - a 'valid_icd_10_cm_flag' to verify if it is a\n-- valid ICD-10-CM code\n--\n-- - a 'ccs_diagnosis_category' column to indicate\n-- the associated diagnosis category\n--\n-- encounter_ids that have no primary diagnosis or\n-- multiple primary diagnoses are not part of this model\n-- because it is impossible to assign a ccs_diagnosis_category\n-- to them. In theory, each encounter should have a unique\n-- ccs_diagnosis_category that is determined by their unique\n-- primary diagnosis ICD-10-CM code.\n\nselect\n aa.encounter_id,\n aa.diagnosis_code,\n aa.diagnosis_rank,\n case\n when bb.icd_10_cm is null then 0\n\telse 1\n end as valid_icd_10_cm_flag,\n cc.ccs_diagnosis_category,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom\n tuva.readmissions._int_stg_diagnosis aa\n left join tuva.terminology.icd_10_cm bb\n on aa.diagnosis_code = bb.icd_10_cm\n left join tuva.readmissions._value_set_icd_10_cm_to_ccs cc\n on aa.diagnosis_code = cc.icd_10_cm\n left join tuva.readmissions._int_primary_diagnosis_count dd\n on aa.encounter_id = dd.encounter_id\n\nwhere\n aa.diagnosis_rank = 1\n and\n dd.primary_dx_count = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter": {"database": "tuva", "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": "aa68e7c72b20c7929afca07dad5a220b2c68589dc0ab4f407317cc48ce38eec8"}, "config": {"enabled": true, "alias": "_int_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.4082005, "relation_name": "tuva.readmissions._int_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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(total_paid_amount as numeric) as total_paid_amount,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__encounter') }}", "language": "sql", "refs": [["readmissions__stg_core__encounter"]], "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 as total_paid_amount,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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(total_paid_amount as numeric) as total_paid_amount,\n '2023-09-12 13:15:18.296145+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 as total_paid_amount,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}]}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "tuva", "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": "5afef6c46f8677e7271149154a2821045d9845f2a75b0bb70243dde5ccc71422"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3629663, "relation_name": "tuva.readmissions._int_encounter_data_quality", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 (cc.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 ( (dd.primary_dx_count is null)\r\n\t or\r\n\t (dd.primary_dx_count = 0)\r\n\t\tor\r\n\t\t(dd.primary_dx_count = 1 and bb.diagnosis_code is null) )\r\n\t then 1\r\n\telse 0\r\n end as missing_primary_diagnosis_flag,\r\n case\r\n when dd.primary_dx_count > 1 then 1\r\n\telse 0\r\n end as multiple_primary_diagnoses_flag,\r\n case\r\n when bb.valid_icd_10_cm_flag = 0 then 1\r\n\telse 0\r\n end as invalid_primary_diagnosis_code_flag,\r\n case\r\n when ( bb.valid_icd_10_cm_flag = 1\r\n\t and\r\n\t bb.ccs_diagnosis_category is null )\r\n then 1\r\n\telse 0\r\n end as no_diagnosis_ccs_flag,\r\n bb.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 ee.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') }} aa\r\n left join {{ ref('readmissions__diagnosis_ccs') }} bb\r\n on aa.encounter_id = bb.encounter_id\r\n left join {{ ref('terminology__discharge_disposition') }} cc\r\n on aa.discharge_disposition_code = cc.discharge_disposition_code\r\n left join {{ ref('readmissions__primary_diagnosis_count') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n left join {{ ref('terminology__ms_drg') }} ee\r\n on aa.ms_drg_code = ee.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 (multiple_primary_diagnoses_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 multiple_primary_diagnoses_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": [["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"], ["readmissions__encounter"], ["readmissions__diagnosis_ccs"], ["terminology__discharge_disposition"], ["readmissions__primary_diagnosis_count"], ["terminology__ms_drg"]], "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", "model.the_tuva_project.readmissions__diagnosis_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "model.the_tuva_project.readmissions__primary_diagnosis_count", "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 (cc.discharge_disposition_code is null) then 1\n\telse 0\n end as invalid_discharge_disposition_code_flag,\n case\n when ( (dd.primary_dx_count is null)\n\t or\n\t (dd.primary_dx_count = 0)\n\t\tor\n\t\t(dd.primary_dx_count = 1 and bb.diagnosis_code is null) )\n\t then 1\n\telse 0\n end as missing_primary_diagnosis_flag,\n case\n when dd.primary_dx_count > 1 then 1\n\telse 0\n end as multiple_primary_diagnoses_flag,\n case\n when bb.valid_icd_10_cm_flag = 0 then 1\n\telse 0\n end as invalid_primary_diagnosis_code_flag,\n case\n when ( bb.valid_icd_10_cm_flag = 1\n\t and\n\t bb.ccs_diagnosis_category is null )\n then 1\n\telse 0\n end as no_diagnosis_ccs_flag,\n bb.ccs_diagnosis_category as diagnosis_ccs,\n case\n when aa.encounter_id in (select distinct encounter_id_A\n\t from tuva.readmissions._int_encounter_overlap )\n\t or\n\t aa.encounter_id in (select distinct encounter_id_B\n\t from tuva.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 ee.ms_drg_code is null then 1\n\telse 0\n end as invalid_ms_drg_flag\n\nfrom tuva.readmissions._int_encounter aa\n left join tuva.readmissions._int_diagnosis_ccs bb\n on aa.encounter_id = bb.encounter_id\n left join tuva.terminology.discharge_disposition cc\n on aa.discharge_disposition_code = cc.discharge_disposition_code\n left join tuva.readmissions._int_primary_diagnosis_count dd\n on aa.encounter_id = dd.encounter_id\n left join tuva.terminology.ms_drg ee\n on aa.ms_drg_code = ee.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 (multiple_primary_diagnoses_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 multiple_primary_diagnoses_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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "tuva", "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": "b84bceb51ad086d73b05fb665e30acab90f60dc47f5061ebaf0fcae37d304ae8"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3671865, "relation_name": "tuva.readmissions._int_encounter_overlap", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"]], "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 tuva.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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "tuva", "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": "9f686a372bb3c4705326b2c938583d552e43801622d7116618b5cf89b99de6dd"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3702443, "relation_name": "tuva.readmissions._int_encounter_specialty_cohort", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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__diagnosis_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": [["readmissions__procedure_ccs"], ["readmissions__surgery_gynecology_cohort"], ["readmissions__specialty_cohort"], ["readmissions__diagnosis_ccs"], ["readmissions__specialty_cohort"], ["readmissions__encounter"]], "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__diagnosis_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 tuva.readmissions._int_procedure_ccs proc\n left join tuva.readmissions._value_set_surgery_gynecology_cohort sgc\n on proc.procedure_code = sgc.icd_10_pcs\n left join tuva.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 tuva.readmissions._int_diagnosis_ccs diag\n inner join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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": []}, "model.the_tuva_project.readmissions__exclusion": {"database": "tuva", "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": "699d6d6e6f8d44a297493f19e07c12db60014158a6c8b7d7272512e891425039"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3732417, "relation_name": "tuva.readmissions._int_exclusion", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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__diagnosis_ccs') }}\r\nwhere ccs_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\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [["readmissions__diagnosis_ccs"], ["readmissions__exclusion_ccs_diagnosis_category"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__diagnosis_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 tuva.readmissions._int_diagnosis_ccs\nwhere ccs_diagnosis_category in\n (select distinct ccs_diagnosis_category\n from tuva.readmissions._value_set_exclusion_ccs_diagnosis_category )\n)\n\n\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_admission": {"database": "tuva", "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": "2d34ec9441371c8651597177e538b27be84fcfd5cf5742a65e64811197a4adda"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3762417, "relation_name": "tuva.readmissions._int_index_admission", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__index_time_requirement"], ["readmissions__index_discharge_requirement"], ["readmissions__exclusion"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.readmissions._int_encounter a\ninner join tuva.readmissions._int_index_time_requirement b\n on a.encounter_id = b.encounter_id\ninner join tuva.readmissions._int_index_discharge_requirement c\n on a.encounter_id = c.encounter_id\nleft join tuva.readmissions._int_exclusion d\n on a.encounter_id = d.encounter_id\nwhere d.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"database": "tuva", "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": "800e7d266ced014025155d3c9d584849fc5132e54382aa7572e7b1fb863f6f23"}, "config": {"enabled": true, "alias": "_int_index_discharge_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.379429, "relation_name": "tuva.readmissions._int_index_discharge_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__encounter"]], "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 tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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": []}, "model.the_tuva_project.readmissions__index_time_requirement": {"database": "tuva", "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": "f85ec812e7ed57b593ad387b55dae487f29c2c9f9dbb340944f965d134e4b147"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3833513, "relation_name": "tuva.readmissions._int_index_time_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__encounter"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.readmissions._int_encounter\nwhere discharge_date <= (select max(discharge_date)\n from tuva.readmissions._int_encounter ) - 30", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__planned_encounter": {"database": "tuva", "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": "7ba861de4973a8f85cc4248f072b7fbb2a775166b9b831c53c3a62c35df5c729"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3863413, "relation_name": "tuva.readmissions._int_planned_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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__diagnosis_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__diagnosis_ccs') }} dccs\r\nleft join {{ ref('readmissions__acute_diagnosis_icd_10_cm') }} adi\r\n on dccs.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": [["readmissions__procedure_ccs"], ["readmissions__always_planned_ccs_procedure_category"], ["readmissions__diagnosis_ccs"], ["readmissions__always_planned_ccs_diagnosis_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_ccs_procedure_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_icd_10_pcs"], ["readmissions__diagnosis_ccs"], ["readmissions__acute_diagnosis_icd_10_cm"], ["readmissions__acute_diagnosis_ccs"]], "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__diagnosis_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__diagnosis_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 tuva.readmissions._int_procedure_ccs pccs\ninner join tuva.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 tuva.readmissions._int_diagnosis_ccs dccs\ninner join tuva.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 tuva.readmissions._int_procedure_ccs pccs\ninner join tuva.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 tuva.readmissions._int_procedure_ccs pcs\ninner join tuva.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 tuva.readmissions._int_diagnosis_ccs dccs\nleft join tuva.readmissions._value_set_acute_diagnosis_icd_10_cm adi\n on dccs.diagnosis_code = adi.icd_10_cm\nleft join tuva.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 * , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__primary_diagnosis_count": {"database": "tuva", "schema": "readmissions", "name": "readmissions__primary_diagnosis_count", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "unique_id": "model.the_tuva_project.readmissions__primary_diagnosis_count", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__primary_diagnosis_count"], "alias": "_int_primary_diagnosis_count", "checksum": {"name": "sha256", "checksum": "7486544ed5290774b78ca5b30f13ef83788bad5b13136154a77dfcb6c5bc26c6"}, "config": {"enabled": true, "alias": "_int_primary_diagnosis_count", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes a count of primary diagnoses related to each encounter_id in the stg_diagnosis model. In theory, each encounter_id should only have a single primary diagnosis, but this model checks how many primary diagnoses each encounter_id has in the dataset.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_dx_count": {"name": "primary_dx_count", "description": "A positive integer giving the count of primary diagnoses for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_primary_diagnosis_count", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1694466127.3888435, "relation_name": "tuva.readmissions._int_primary_diagnosis_count", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Every encounter should have one and only one primary\r\n-- diagnosis. A potential data quality problem would\r\n-- be to have encounters that have no primary diagnosis\r\n-- or multiple primary diagnoses.\r\n-- Here we list the count of primary diagnoses associated\r\n-- with each encounter in the stg_diagnosis model.\r\n\r\n\r\n\r\n-- Here we list the primary diagnosis count for every\r\n-- encounter_id in the stg_diagnosis model that has\r\n-- at least one primary diagnosis\r\nwith primary_diagnosis_count_greater_than_zero as (\r\nselect\r\n encounter_id,\r\n count(*) as primary_dx_count\r\nfrom {{ ref('readmissions__diagnosis') }}\r\nwhere diagnosis_rank = 1\r\ngroup by encounter_id\r\n),\r\n\r\n\r\n-- Here we list all distinct encounter_ids in the\r\n-- stg_diagnosis model\r\nall_encounter_ids as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__diagnosis') }}\r\n),\r\n\r\n\r\n-- Here we list the primary diagnosis count for every\r\n-- encounter_id in the stg_diagnosis model.\r\n-- The primary_dx_count can be any\r\n-- nonnegative integer: {0,1,2,3,...}\r\nall_primary_diagnosis_count as (\r\nselect\r\n aa.encounter_id,\r\n case\r\n when bb.primary_dx_count is null then 0\r\n\telse bb.primary_dx_count\r\n end as primary_dx_count\r\nfrom\r\n all_encounter_ids aa\r\n left join primary_diagnosis_count_greater_than_zero bb\r\n on aa.encounter_id = bb.encounter_id\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_primary_diagnosis_count", "language": "sql", "refs": [["readmissions__diagnosis"], ["readmissions__diagnosis"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__diagnosis"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__primary_diagnosis_count.sql", "compiled": true, "compiled_code": "\n\n-- Every encounter should have one and only one primary\n-- diagnosis. A potential data quality problem would\n-- be to have encounters that have no primary diagnosis\n-- or multiple primary diagnoses.\n-- Here we list the count of primary diagnoses associated\n-- with each encounter in the stg_diagnosis model.\n\n\n\n-- Here we list the primary diagnosis count for every\n-- encounter_id in the stg_diagnosis model that has\n-- at least one primary diagnosis\nwith primary_diagnosis_count_greater_than_zero as (\nselect\n encounter_id,\n count(*) as primary_dx_count\nfrom tuva.readmissions._int_stg_diagnosis\nwhere diagnosis_rank = 1\ngroup by encounter_id\n),\n\n\n-- Here we list all distinct encounter_ids in the\n-- stg_diagnosis model\nall_encounter_ids as (\nselect distinct encounter_id\nfrom tuva.readmissions._int_stg_diagnosis\n),\n\n\n-- Here we list the primary diagnosis count for every\n-- encounter_id in the stg_diagnosis model.\n-- The primary_dx_count can be any\n-- nonnegative integer: {0,1,2,3,...}\nall_primary_diagnosis_count as (\nselect\n aa.encounter_id,\n case\n when bb.primary_dx_count is null then 0\n\telse bb.primary_dx_count\n end as primary_dx_count\nfrom\n all_encounter_ids aa\n left join primary_diagnosis_count_greater_than_zero bb\n on aa.encounter_id = bb.encounter_id\n)\n\n\n\nselect *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom all_primary_diagnosis_count", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "tuva", "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": "84584613e857ed1c5b88902cab3635d8ebcd675344e78c6df5c75f3fa5eb4770"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3918366, "relation_name": "tuva.readmissions._int_procedure_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__stg_core__procedure"], ["terminology__icd_10_pcs"], ["readmissions__icd_10_pcs_to_ccs"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom\n __dbt__cte__readmissions__stg_core__procedure aa\n left join tuva.terminology.icd_10_pcs bb\n on aa.normalized_code = bb.icd_10_pcs\n left join tuva.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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}]}, "model.the_tuva_project.readmissions__readmission_crude": {"database": "tuva", "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": "ac2709cae4a94c2e2e39a9e89d09dc4276c15c3e2cc2f4813115339c7baf2179"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "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, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "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, "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, "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, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.3985913, "relation_name": "tuva.readmissions._int_readmission_crude", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["readmissions__encounter"], ["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"]], "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 tuva.readmissions._int_encounter enc\nleft join tuva.readmissions._int_encounter_overlap over_a\n on enc.encounter_id = over_a.encounter_id_A\nleft join tuva.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 *, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "tuva", "schema": "claims_data_model", "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": "c4705cc9d628122f8458f631a8ab9c76cec94cc2786a756fa9b3750eec3ab2b1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.4097784, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["core__condition"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "tuva", "schema": "claims_data_model", "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": "c65f5c6f52afbf8a21fa3c043db1ebc4a5cc373ca2e891300bc17cddfef237f3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.4108741, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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 as total_paid_amount,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\nwhere encounter_type = 'acute inpatient'", "language": "sql", "refs": [["core__encounter"]], "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 as total_paid_amount,\n '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__medical_claim": {"database": "tuva", "schema": "claims_data_model", "name": "readmissions__stg_core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__medical_claim", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__medical_claim"], "alias": "readmissions__stg_core__medical_claim", "checksum": {"name": "sha256", "checksum": "6a5a89e6c24a55d72a531de9174a952f3ef9174b321ef6edd85dd5dee5df1858"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.413785, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\r\n, encounter_id\r\n, encounter_type\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, encounter_id\n, encounter_type\n, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "tuva", "schema": "claims_data_model", "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": "d0ef7f22c43c889710e61c50fecd24d9b9e18a212bfeb6bfc755ee6cc96f3eb4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.4148643, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\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": [["core__procedure"]], "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, '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": {"database": "tuva", "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": "365a11f6c2dd3d55cd23af732ea2fc555d6decb29e2087a79646c8e048a28492"}, "config": {"enabled": true, "alias": "patient_risk_factors_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "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": true}, "created_at": 1694466126.112928, "relation_name": "tuva.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('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n", "language": "sql", "refs": [["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_factors"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\n\n\nselect * from tuva.cms_hcc.patient_risk_factors\n", "extra_ctes_injected": true, "extra_ctes": []}, "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": {"database": "tuva", "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": "7eb3451462fca7a97e24a7d6ae24719e1e57850ea1da3d61d2f74f73506819bb"}, "config": {"enabled": true, "alias": "patient_risk_scores_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "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||model_version||payment_year||tuva_last_run", "enabled": true}, "created_at": 1694466126.1206732, "relation_name": "tuva.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||model_version||payment_year||tuva_last_run\"\r\n , \"enabled\": var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_scores') }}\r\n\r\n", "language": "sql", "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\n\n\nselect * from tuva.cms_hcc.patient_risk_scores\n", "extra_ctes_injected": true, "extra_ctes": []}, "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": {"database": "tuva", "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": "579cc81c5b8d38420977f754fd9a3e3b2d3507b64a079e06062620420d3546fd"}, "config": {"enabled": true, "alias": "summary_counts_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "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": true}, "created_at": 1694466126.1256535, "relation_name": "tuva.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('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_counts') }}\r\n\r\n", "language": "sql", "refs": [["quality_measures__summary_counts"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__summary_counts"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\n\n\nselect * from tuva.quality_measures.summary_counts\n", "extra_ctes_injected": true, "extra_ctes": []}, "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": {"database": "tuva", "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": "0d68ebe6ba4ebdc2f87f463e42d0c46d827d42b7d85bc6a27afbe81b0faaffbc"}, "config": {"enabled": true, "alias": "summary_long_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "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": true}, "created_at": 1694466126.1322205, "relation_name": "tuva.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('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_long') }}\r\n\r\n", "language": "sql", "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\n\n\nselect * from tuva.quality_measures.summary_long\n", "extra_ctes_injected": true, "extra_ctes": []}, "seed.the_tuva_project.terminology__admit_source": {"database": "tuva", "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": "52cfafd223b8a134e28057eafb78f93e53f119156fa9ef6603ca372266a6e4c5"}, "config": {"enabled": true, "alias": "admit_source", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.419651, "relation_name": "tuva.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__admit_type": {"database": "tuva", "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": "3346cb56b5216d56f0a7f4260e1e85f9fb83697e5020cbcfc198da65edaeb449"}, "config": {"enabled": true, "alias": "admit_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "admit_type", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.4236255, "relation_name": "tuva.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ansi_fips_state": {"database": "tuva", "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": "e4137e40ea8d3ff1bdfb3c661f898d05f0b71f7b5f46ef7ad38ad176e2d306a0"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.4655669, "relation_name": "tuva.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__apr_drg": {"database": "tuva", "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": "7644458580dcc94c2982457f23b2510997e68249783c1bd9132d9c748066e8bc"}, "config": {"enabled": true, "alias": "apr_drg", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "apr_drg", "tags": ["terminology", "data_profiling"], "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.567487, "relation_name": "tuva.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__bill_type": {"database": "tuva", "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": "df4c7c4855d7aeb9f06f1595d00b58a26292a667c2394924c41b791982f575e5"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.4281588, "relation_name": "tuva.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__calendar": {"database": "tuva", "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": "cd7f87880a1e1f0c4e098ef6584cdd711d3431b331054ac9bc61bcd1f52ee52b"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','calendar.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','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": "#460d4f"}}, "created_at": 1694466127.4386268, "relation_name": "tuva.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "bce5496f01c098e7707ae90a5d30e622ede0cc119b80898881b79217a6e36ba1"}, "config": {"enabled": true, "alias": "claim_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "claim_type", "tags": ["terminology", "data_profiling"], "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.4416187, "relation_name": "tuva.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__code_type": {"database": "tuva", "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": "d99b5d1f18b130e99e1c1f80f9fe83a7f7e09f311e19327d07ba840941a983cb"}, "config": {"enabled": true, "alias": "code_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "code_type", "tags": ["terminology", "data_profiling"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.4461179, "relation_name": "tuva.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__discharge_disposition": {"database": "tuva", "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": "102f68b0e0d114d517f8896164e534ec4623b500519bcb427952573b721e374e"}, "config": {"enabled": true, "alias": "discharge_disposition", "schema": "terminology", "database": null, "tags": [], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "discharge_disposition", "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.4506261, "relation_name": "tuva.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__encounter_type": {"database": "tuva", "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": "b823346a3c0ff0288107da5f53bee8064bc61bbff3a44a0642574a9cc1cd47ea"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "encounter_type", "tags": ["terminology", "claims_preprocessing"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.4536068, "relation_name": "tuva.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ethnicity": {"database": "tuva", "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": "2756d8fc5cb0632232b61ec93564639f42b79cc58080e58802defdc2f08beb49"}, "config": {"enabled": true, "alias": "ethnicity", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ethnicity", "tags": "terminology", "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.457183, "relation_name": "tuva.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__fips_county": {"database": "tuva", "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": "39792877b3b9ef63bd80b51db7f7afc5758ce61266837e5fcf60eac5d902b97b"}, "config": {"enabled": true, "alias": "fips_county", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "fips_county", "tags": "terminology", "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.4608884, "relation_name": "tuva.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__gender": {"database": "tuva", "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": "643b3aba4aed1f3d91f07e343e90360ba91f3ac33994fe2fbe3c7681510cdcbb"}, "config": {"enabled": true, "alias": "gender", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "gender", "tags": ["terminology", "data_profiling"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.469419, "relation_name": "tuva.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"database": "tuva", "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": "path", "checksum": "seeds\\terminology\\terminology__hcpcs_level_2.csv"}, "config": {"enabled": true, "alias": "hcpcs_level_2", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.4744763, "relation_name": "tuva.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__icd_10_cm": {"database": "tuva", "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": "08903dd5b951cfdd2dc1e2d92406571ab08c2fa401c2f951a6190b38af1dbf61"}, "config": {"enabled": true, "alias": "icd_10_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','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": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','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", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.481659, "relation_name": "tuva.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "f17eb0d946b77499e0fb9196e1993dc4e6212b8932f0b7bea054be5ba13ce50e"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','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": "#460d4f"}}, "created_at": 1694466127.4881678, "relation_name": "tuva.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "path", "checksum": "seeds\\terminology\\terminology__icd_9_cm.csv"}, "config": {"enabled": true, "alias": "icd_9_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.4932177, "relation_name": "tuva.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__icd_9_pcs": {"database": "tuva", "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": "dc97df38ffbff5dddcd6e0160d41f76c3d29b7d740b583faaac1a5de86698fab"}, "config": {"enabled": true, "alias": "icd_9_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.499445, "relation_name": "tuva.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__mdc": {"database": "tuva", "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": "478273d43b2a5da8f36fb12d6b89a8e64e90fb85a44b8c34e4f607b1bb78dfe5"}, "config": {"enabled": true, "alias": "mdc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "mdc", "tags": "terminology", "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.503431, "relation_name": "tuva.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"database": "tuva", "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": "0129d0377cfb0a7510cd8e0270f9f835a5ade1bca963479a86076cd1828de709"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.5064235, "relation_name": "tuva.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_status": {"database": "tuva", "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": "a303d26035b0a620409823260cf237836aebda917c5f80706a4f84c6664ef151"}, "config": {"enabled": true, "alias": "medicare_status", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "medicare_status", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.5156736, "relation_name": "tuva.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ms_drg": {"database": "tuva", "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": "e5b574ab858ae97a820046cf42c3068c45e25457ab3ddcbdbc7e22281a386941"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.5214918, "relation_name": "tuva.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"database": "tuva", "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": {}, "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": "#460d4f"}, "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": {}, "docs": {"show": true, "node_color": "#460d4f"}, "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": "#460d4f"}}, "created_at": 1694466127.5291119, "relation_name": "tuva.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "84ad06d9900eba3d6ccf8e462df196e9d2499fe0cb08882eb5f67323dc8ba33a"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "payer_type", "tags": ["terminology", "data_profiling"], "column_types": {"payer_type": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.533175, "relation_name": "tuva.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__place_of_service": {"database": "tuva", "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": "7ac7b69c217edab985ea2e1a59113093fe90fc6890af052d71b5a4cfd12ce180"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#460d4f"}}, "created_at": 1694466127.5371783, "relation_name": "tuva.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__present_on_admission": {"database": "tuva", "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": "58c7c47c9822c23c7a0518bcef0d10794e5c29d0cf3d98f141e70fd7a73f480d"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "present_on_admission", "tags": ["terminology", "data_profiling", "claims_preprocessing"], "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.5408514, "relation_name": "tuva.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__provider": {"database": "tuva", "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": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','provider.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "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','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": "#460d4f"}}, "created_at": 1694466127.5540266, "relation_name": "tuva.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "cd381b8fbf1fdedfdbb3f28f961c5eb763d3f4bb9088d4426c91f93f60e4dd34"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"race_code": "varchar", "race_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "race", "tags": ["terminology", "data_profiling"], "column_types": {"race_code": "varchar", "race_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.5576599, "relation_name": "tuva.terminology.race", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__revenue_center": {"database": "tuva", "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": "3c650ef496d7ec010eec2543da454ad31dba96452753b48981252de68d72ba65"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "revenue_center", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.5622559, "relation_name": "tuva.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ssa_fips_state": {"database": "tuva", "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": "39debce4523ac23a14548c046752a7d7b70b7877f8bce5ec94a07de1a6788286"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "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": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ssa_fips_state", "tags": "terminology", "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1694466127.510664, "relation_name": "tuva.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "tuva", "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": "dd8b64d00c38d7a99174fa8d2b6b82f2eae2b039e7ef0cd00da36d3233d6b326"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_body_systems", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_body_systems", "tags": ["ccsr"], "enabled": true}, "created_at": 1694466127.5960536, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"database": "tuva", "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": {}, "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": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','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": {}, "docs": {"show": true, "node_color": null}, "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/value-sets','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"}}, "created_at": 1694466127.5840714, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "e26501963b41e323fcebadca74e051da890db7c264e0c0bbdc906862bc600a84"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "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": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','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": {}, "docs": {"show": true, "node_color": null}, "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/value-sets','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"}}, "created_at": 1694466127.5915532, "relation_name": "tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "path", "checksum": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "config": {"enabled": true, "alias": "_value_set_cms_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "CMS generated grouping of ICD 10 codes into chronic conditions groups", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\cms_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_value_set_cms_chronic_conditions_hierarchy", "tags": ["cms_chronic_conditions", "chronic_conditions"], "enabled": true, "docs": {"node_color": "#804912"}}, "created_at": 1694466127.5995555, "relation_name": "tuva.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"database": "tuva", "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": "15ce75a34050c084ac8f8cfa265f100db069114a3dd0f9a55c8db01150733453"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "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": {"condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up into", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_description": {"name": "icd_10_cm_description", "description": "The description for the icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_column_name": {"name": "condition_column_name", "description": "The name of the column as it will appear in chronic_conditions_wide", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\tuva_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_value_set_tuva_chronic_conditions_hierarchy", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "enabled": true, "docs": {"node_color": "#804912"}}, "created_at": 1694466127.6075165, "relation_name": "tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"database": "tuva", "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": "8cb085133b926383e2030fd987d3023588b57a90f8b8e87a20e6a289ca58f0ac"}, "config": {"enabled": true, "alias": "_value_set_adjustment_rates", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Adjustment rates by payment year. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "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_adjustment_rates", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1694466127.6112082, "relation_name": "tuva.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"database": "tuva", "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": "4734b5b9047622e7d95f6b220e392afb8b80d53aa9b8be52785d050cd2adb835"}, "config": {"enabled": true, "alias": "_value_set_cpt_hcpcs", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_cpt_hcpcs", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}}, "created_at": 1694466127.6177406, "relation_name": "tuva.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"database": "tuva", "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": "8f0d031051368f019fcb9b42986eb2b83f55e3c0f50b4b622ccb33052c170971"}, "config": {"enabled": true, "alias": "_value_set_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_demographic_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1694466127.6211486, "relation_name": "tuva.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"database": "tuva", "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": "10ecd34b010e98de03921020bab64f1221645289533b40b691ed3e73049d8e76"}, "config": {"enabled": true, "alias": "_value_set_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_disabled_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "coefficient": "float"}}, "created_at": 1694466127.625163, "relation_name": "tuva.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_factors": {"database": "tuva", "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": "76d0db09692f13952544adbc6b27647967b5606d4a6a7afca91627fe41dffe53"}, "config": {"enabled": true, "alias": "_value_set_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "coefficient": "float"}}, "created_at": 1694466127.6311796, "relation_name": "tuva.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"database": "tuva", "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": "0c8832760b5a65fcd7dbb31550cc6ade98bfd4293427911cb13ac7960c541734"}, "config": {"enabled": true, "alias": "_value_set_disease_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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": null}, "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": {}, "docs": {"show": true, "node_color": null}, "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"}}, "created_at": 1694466127.6378207, "relation_name": "tuva.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "tuva", "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": "3c939b7a8df5d3330c4cf935d068839119019553beb2438dab0baf2b466f0478"}, "config": {"enabled": true, "alias": "_value_set_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"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": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}}, "created_at": 1694466127.6455867, "relation_name": "tuva.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"database": "tuva", "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": "6e29ef73efbce47b7dab2ec4e6ce5d521d35d83f14a0f1f130329aab8948492c"}, "config": {"enabled": true, "alias": "_value_set_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_enrollment_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1694466127.650104, "relation_name": "tuva.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"database": "tuva", "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": "path", "checksum": "seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "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"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_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"}}, "created_at": 1694466127.6551595, "relation_name": "tuva.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"database": "tuva", "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": "37d33e7a0bb8ad97f5bd24132f2e8a5af2deb11b1ce0acf07bc1bab822ecd98c"}, "config": {"enabled": true, "alias": "_value_set_payment_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "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": {}, "docs": {"show": true, "node_color": null}, "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_payment_hcc_count_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1694466127.6577358, "relation_name": "tuva.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.data_profiling__test_catalog": {"database": "tuva", "schema": "data_profiling", "name": "data_profiling__test_catalog", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\data_profiling\\data_profiling__test_catalog.csv", "original_file_path": "seeds\\value_sets\\data_profiling\\data_profiling__test_catalog.csv", "unique_id": "seed.the_tuva_project.data_profiling__test_catalog", "fqn": ["the_tuva_project", "value_sets", "data_profiling", "data_profiling__test_catalog"], "alias": "_value_set_test_catalog", "checksum": {"name": "sha256", "checksum": "e2c0eb3fa96e8e3548466d5ca9b197f46b58e1998c9786940089759c8d0f019a"}, "config": {"enabled": true, "alias": "_value_set_test_catalog", "schema": "data_profiling", "database": null, "tags": ["data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://seeds\\value_sets\\data_profiling\\data_profiling__seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_profiling", "alias": "_value_set_test_catalog", "tags": ["data_profiling"], "enabled": true, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "docs": {"node_color": "#141161"}}, "created_at": 1694466127.664838, "relation_name": "tuva.data_profiling._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures__concepts": {"database": "tuva", "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": "f28cb3d205e5b4cb76aaa18ef4ea22fa1cc01449da26c7344f67af23337936d7"}, "config": {"enabled": true, "alias": "_value_set_concepts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Measures to concepts crosswalk. List of concepts used in each reporting measure.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_concepts", "tags": "quality_measures", "enabled": true}, "created_at": 1694466127.67168, "relation_name": "tuva.quality_measures._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures__measures": {"database": "tuva", "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": "77e87e4828fb399da7178ace19a326e18d866818f81f21b3b5fa217b8e73032d"}, "config": {"enabled": true, "alias": "_value_set_measures", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_measures", "tags": "quality_measures", "enabled": true}, "created_at": 1694466127.6686428, "relation_name": "tuva.quality_measures._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures__value_sets": {"database": "tuva", "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": "366585cf53299971c7c9adb3e0766053b9302dddee7f4d91ee543f955a6a8053"}, "config": {"enabled": true, "alias": "_value_set_codes", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_codes", "tags": "quality_measures", "enabled": true, "column_types": {"code": "varchar"}}, "created_at": 1694466127.6746771, "relation_name": "tuva.quality_measures._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"database": "tuva", "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": "25a6477a528bc5ca29fd8153e9ed5e2d57e51ea0083d9d7b4ee288094b53ddfc"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_acute_diagnosis_ccs", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1694466127.682508, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"database": "tuva", "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": "path", "checksum": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_icd_10_cm", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1694466127.6889925, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"database": "tuva", "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": "dae8093b0f00521519e1b68d90c82a63057d563a32bbd432372ee21757332298"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.6942136, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "tuva", "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": "d4489c038d0c6f13f3d555b5341190a9cc1f517bd3f8e6be1dd2a9798c1be68f"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.7004488, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "tuva", "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": "3ae458aa6c04a94f0a242e2a95300ff1a7836b6b195c484c446d5d1d91006e42"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1694466127.7044308, "relation_name": "tuva.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"database": "tuva", "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": "2179b7310d7d12968dab5eed9efabf25e3a272c2e444e772e6c225b520c24236"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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/value-sets','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": "#161a7d"}}, "created_at": 1694466127.7126484, "relation_name": "tuva.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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/value-sets','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": "#161a7d"}}, "created_at": 1694466127.720501, "relation_name": "tuva.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\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": "tuva", "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": "05ebf37f0e71131e482e21ca079a59dbefe226bb90bec20ff623947ff29e63fe"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1694466127.7244172, "relation_name": "tuva.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"database": "tuva", "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": "43261c6967146c62f4d8e9a98b6a00e136601da9027728dd2feba3dad3222ddd"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1694466127.7284317, "relation_name": "tuva.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__specialty_cohort": {"database": "tuva", "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": "22f4176d10237dcdd38294fc1e02cf0f17e8b9af193b91309b23949304f78608"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"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": "#161a7d"}}, "created_at": 1694466127.7359185, "relation_name": "tuva.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"database": "tuva", "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": "b897008e5e7dc4d4f2c62272fb8ecaed11cbe56203c8eb8bf5e1c11b40a16d77"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "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": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "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": "#161a7d"}}, "created_at": 1694466127.740704, "relation_name": "tuva.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "tuva", "schema": "service_category", "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": "402bb239dab4163118f57998f27f386aaf30e09bea301b6f0d4f8be15862a8d4"}, "config": {"enabled": true, "alias": "_value_set_service_categories", "schema": "service_category", "database": null, "tags": ["service_category"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["service_category"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\service_categories\\service_categories_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "service_category", "alias": "_value_set_service_categories", "tags": ["service_category"], "enabled": true}, "created_at": 1694466127.7442806, "relation_name": "tuva.service_category._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466126.509869, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["ccsr__singular_condition_category"]], "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 tuva.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466126.5112867, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["ccsr__singular_condition_category"]], "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 tuva.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": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1694466126.5790825, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "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 tuva.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": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5811315, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "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 tuva.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5821574, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "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 tuva.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5831497, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "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 tuva.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5841503, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "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 tuva.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1694466126.5851457, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "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 tuva.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": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5861378, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5877254, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.588755, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5897934, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5907893, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.5918095, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1694466126.5933337, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "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 tuva.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": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.6026156, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.6046088, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.6056054, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "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 tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1694466126.6056054, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "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 tuva.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": [], "column_name": "condition", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1694466126.6406963, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_long"]], "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 tuva.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": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1694466126.64171, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "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 tuva.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": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "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": 1694466126.6432836, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "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 tuva.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide"}, "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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1694466126.9691713, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__patient_risk_scores"]], "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 tuva.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": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_demographic_factors')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_demographic_factors_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_demographic_factors_patient_id.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.1e7ac0d681", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_demographic_factors_patient_id"], "alias": "unique_cms_hcc__int_demographic_factors_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1694466126.9701653, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"]], "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_demographic_factors_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom tuva.cms_hcc._int_demographic_factors\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1694466126.971161, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_eligible_conditions"]], "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 tuva.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition_code", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1694466126.9721644, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_members"]], "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 tuva.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1694466126.9741101, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_members"]], "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 tuva.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": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members"}, "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || year_month)", "model": "{{ get_where_subquery(ref('financial_pmpm__pmpm_prep')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_financial_pmpm__pmpm_prep__patient_id___year_month_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_financial_pmpm__pmpm_prep__patient_id___year_month_.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_.ae2161e384", "fqn": ["the_tuva_project", "financial_pmpm", "unique_financial_pmpm__pmpm_prep__patient_id___year_month_"], "alias": "unique_financial_pmpm__pmpm_prep__patient_id___year_month_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1694466127.211929, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["financial_pmpm__pmpm_prep"]], "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_prep__patient_id___year_month_.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || year_month) as unique_field,\n count(*) as n_records\n\nfrom tuva.financial_pmpm.pmpm_prep\nwhere (patient_id || '_' || year_month) is not null\ngroup by (patient_id || '_' || year_month)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3082395, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__condition"]], "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 , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3107553, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__encounter"]], "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_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.encounter\n\n\n)"}], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3127465, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__medication"]], "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 , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n\n)"}], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.31474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__observation"]], "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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n)"}], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3157363, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "patient_id", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3173473, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["female", "male"], "column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "accepted_values_quality_measures__stg_core__patient_sex__female__male", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897.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.47cbdf864b", "fqn": ["the_tuva_project", "quality_measures", "accepted_values_quality_measures__stg_core__patient_sex__female__male"], "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897"}, "created_at": 1694466127.3193424, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_12782dbc4c931575c089a8978147a897\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "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_12782dbc4c931575c089a8978147a897.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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'\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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "sex", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3223653, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "column_name": "birth_date", "file_key_name": "models.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": "tuva", "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": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1694466127.3234253, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__procedure"]], "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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.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 , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-12 13:15:18.296145+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure"}}, "sources": {}, "macros": {"macro.claims_data_model.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\generate_schema_name.sql", "original_file_path": "../macros\\generate_schema_name.sql", "unique_id": "macro.claims_data_model.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": 1694466123.771774, "supported_languages": null}, "macro.claims_data_model.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.claims_data_model.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.claims_data_model.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.775147, "supported_languages": null}, "macro.claims_data_model.bigquery__try_to_cast_date": {"name": "bigquery__try_to_cast_date", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.claims_data_model.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": 1694466123.775147, "supported_languages": null}, "macro.claims_data_model.default__try_to_cast_date": {"name": "default__try_to_cast_date", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.claims_data_model.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": 1694466123.775147, "supported_languages": null}, "macro.claims_data_model.postgres__try_to_cast_date": {"name": "postgres__try_to_cast_date", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.claims_data_model.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": 1694466123.7766476, "supported_languages": null}, "macro.claims_data_model.redshift__try_to_cast_date": {"name": "redshift__try_to_cast_date", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.claims_data_model.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": 1694466123.7771587, "supported_languages": null}, "macro.claims_data_model.snowflake__try_to_cast_date": {"name": "snowflake__try_to_cast_date", "resource_type": "macro", "package_name": "claims_data_model", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.claims_data_model.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": 1694466123.7771587, "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 }} {% 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_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.791636, "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": 1694466123.791636, "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": 1694466123.7931406, "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 {% 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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.7941449, "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": 1694466123.7951405, "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": 1694466123.7961373, "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": 1694466123.7971349, "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 schemas 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": 1694466123.7982748, "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": 1694466123.7982748, "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": 1694466123.7982748, "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": 1694466123.7992723, "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": 1694466123.7992723, "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": 1694466123.8002715, "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": 1694466123.8002715, "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": 1694466123.8002715, "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": 1694466123.8012686, "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": 1694466123.8012686, "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": 1694466123.8022654, "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": 1694466123.8032622, "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": 1694466123.8032622, "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": 1694466123.8032622, "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": 1694466123.8042588, "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": 1694466123.8042588, "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": 1694466123.8052552, "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": 1694466123.8077514, "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": 1694466123.8129413, "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": 1694466123.8129413, "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": 1694466123.814935, "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": 1694466123.814935, "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": 1694466123.814935, "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": 1694466123.8175015, "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": 1694466123.8185015, "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": 1694466123.8185015, "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": 1694466123.8214908, "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 df.write.mode(\"overwrite\").save_as_table(\"{{ target_relation }}\", 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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.8214908, "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": 1694466123.8214908, "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": 1694466123.8224921, "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 return(to_return) %}\n\n {% do unset_query_tag(original_query_tag) %}\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": 1694466123.8234844, "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": 1694466123.8234844, "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": 1694466123.8234844, "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": 1694466123.8234844, "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": 1694466123.824481, "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": 1694466123.824481, "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": 1694466123.824481, "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": 1694466123.824481, "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": 1694466123.824481, "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": 1694466123.8254774, "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": 1694466123.8254774, "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": 1694466123.827189, "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": 1694466123.827189, "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": 1694466123.8282309, "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": 1694466123.8282309, "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": 1694466123.8282309, "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": 1694466123.8282309, "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": 1694466123.8295772, "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": 1694466123.8295772, "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": 1694466123.8295772, "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": 1694466123.8305774, "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": 1694466123.8305774, "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": 1694466123.8305774, "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": 1694466123.8316517, "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": 1694466123.8316517, "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": 1694466123.8316517, "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": 1694466123.8326638, "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": 1694466123.8336482, "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": 1694466123.8356397, "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": 1694466123.8356397, "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": 1694466123.8356397, "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": 1694466123.8356397, "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 select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.8373473, "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": 1694466123.8373473, "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": 1694466123.8384235, "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": 1694466123.8384235, "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": 1694466123.839453, "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": 1694466123.839453, "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').table) }}\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": 1694466123.84043, "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": 1694466123.84043, "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": 1694466123.841407, "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": 1694466123.841407, "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": 1694466123.841407, "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": 1694466123.8430018, "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": 1694466123.8440573, "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": 1694466123.8440573, "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": 1694466123.8440573, "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": 1694466123.8440573, "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": 1694466123.8450565, "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": 1694466123.8450565, "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": 1694466123.8460178, "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": 1694466123.8460178, "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": 1694466123.8460178, "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": 1694466123.8470147, "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": 1694466123.847595, "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": 1694466123.847595, "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": 1694466123.847595, "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": 1694466123.847595, "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": 1694466123.8486674, "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": 1694466123.8516557, "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": 1694466123.8516557, "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": 1694466123.8526523, "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": 1694466123.8526523, "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": 1694466123.8526523, "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": 1694466123.8536818, "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": 1694466123.8536818, "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": 1694466123.8536818, "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": 1694466123.8536818, "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": 1694466123.8546488, "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": 1694466123.8546488, "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": 1694466123.8546488, "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": 1694466123.8546488, "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": 1694466123.855656, "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": 1694466123.855656, "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": 1694466123.855656, "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": 1694466123.855656, "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": 1694466123.8572323, "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": 1694466123.8572323, "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": 1694466123.8572323, "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": 1694466123.8572323, "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": 1694466123.8583188, "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": 1694466123.8583188, "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": 1694466123.8583188, "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": 1694466123.8583188, "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": 1694466123.8583188, "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": 1694466123.8583188, "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": 1694466123.8583188, "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": 1694466123.859891, "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": 1694466123.8624084, "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": 1694466123.8644145, "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": 1694466123.8659165, "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": 1694466123.8659165, "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": 1694466123.8675191, "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": 1694466123.8685179, "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": 1694466123.8685179, "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": 1694466123.869514, "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": 1694466123.869514, "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": 1694466123.8705106, "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": 1694466123.8705106, "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": 1694466123.8715072, "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 is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_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": 1694466123.8715072, "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": 1694466123.8715072, "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": 1694466123.8725038, "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": 1694466123.8725038, "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": 1694466123.8735003, "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": 1694466123.8735003, "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": 1694466123.8735003, "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": 1694466123.874497, "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": 1694466123.874497, "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": 1694466123.8754935, "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": 1694466123.8764908, "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": 1694466123.8764908, "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": 1694466123.8772194, "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": 1694466123.877275, "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": 1694466123.879271, "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": 1694466123.8802698, "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": 1694466123.8813455, "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": 1694466123.8813455, "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": 1694466123.8823407, "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": 1694466123.8879094, "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": 1694466123.8889868, "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": 1694466123.8951232, "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": 1694466123.898582, "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": 1694466123.898582, "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": 1694466123.900587, "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": 1694466123.900587, "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": 1694466123.9015703, "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": 1694466123.9070857, "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": 1694466123.9096155, "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": 1694466123.9106286, "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": 1694466123.9126227, "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": 1694466123.9136202, "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": 1694466123.9136202, "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": 1694466123.9136202, "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": 1694466123.9146159, "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": 1694466123.9146159, "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": 1694466123.9146159, "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": 1694466123.915612, "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": 1694466123.915612, "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": 1694466123.915612, "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": 1694466123.915612, "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": 1694466123.915612, "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": 1694466123.917126, "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": 1694466123.917126, "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": 1694466123.918144, "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 as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.918144, "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": 1694466123.9221475, "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=True) %}\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": 1694466123.9241257, "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": 1694466123.9241257, "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": 1694466123.9251223, "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": 1694466123.9251223, "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 }} as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466123.9251223, "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": 1694466123.9251223, "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": 1694466123.9266934, "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": 1694466123.9302015, "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": 1694466123.9351854, "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": 1694466123.9361818, "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": 1694466123.937179, "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": 1694466123.937179, "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": 1694466123.937179, "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": 1694466123.93832, "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": 1694466123.93832, "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": 1694466123.93832, "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": 1694466123.93832, "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": 1694466123.93832, "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": 1694466123.9393172, "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": 1694466123.9393172, "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": 1694466123.9413135, "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": 1694466123.9458077, "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": 1694466123.9503288, "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": 1694466123.9503288, "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": 1694466123.9503288, "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": 1694466123.9513223, "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": 1694466123.9513223, "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": 1694466123.9513223, "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": 1694466123.9513223, "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": 1694466123.9523177, "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": 1694466123.9533143, "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": 1694466123.9533143, "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": 1694466123.9543114, "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": 1694466123.961321, "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": 1694466123.9623175, "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": 1694466123.962819, "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": 1694466123.965811, "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": 1694466123.965811, "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": 1694466123.9673123, "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": 1694466123.9683454, "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": 1694466123.9683454, "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": 1694466123.9683454, "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 select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) 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": 1694466123.9703395, "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": 1694466123.9723337, "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": 1694466123.9733303, "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": 1694466123.9733303, "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": 1694466123.9763198, "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": 1694466123.9768212, "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": 1694466123.9773233, "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": 1694466123.979364, "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": 1694466123.979364, "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 resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\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": 1694466123.9803622, "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": 1694466123.9813585, "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": 1694466123.982355, "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: ref(*args, 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": 1694466123.982355, "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": 1694466123.982355, "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": 1694466123.9833517, "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": 1694466123.9833517, "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": 1694466123.9833517, "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": 1694466123.9833517, "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": 1694466123.9843483, "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": 1694466123.9843483, "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": 1694466123.9843483, "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": 1694466123.9853454, "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": 1694466123.9853454, "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": 1694466123.9853454, "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": 1694466123.9853454, "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": 1694466123.9853454, "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": 1694466123.986342, "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": 1694466123.986342, "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": 1694466123.9878402, "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": 1694466123.9878402, "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": 1694466123.9878402, "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": 1694466123.9878402, "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": 1694466123.9878402, "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": 1694466123.9888382, "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": 1694466123.9888382, "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": 1694466123.9888382, "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": 1694466123.9888382, "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": 1694466123.9898362, "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": 1694466123.9898362, "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": 1694466123.9898362, "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": 1694466123.9898362, "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": 1694466123.9898362, "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": 1694466123.9908328, "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": 1694466123.9908328, "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": 1694466123.9908328, "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": 1694466123.9918294, "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": 1694466123.9918294, "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": 1694466123.9918294, "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": 1694466123.9918294, "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": 1694466123.9918294, "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": 1694466123.9918294, "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": 1694466123.993331, "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": 1694466123.993331, "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": 1694466123.993331, "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": 1694466123.994333, "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": 1694466123.994333, "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": 1694466123.994333, "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": 1694466123.9953299, "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": 1694466123.9953299, "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": 1694466123.9953299, "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": 1694466123.9963267, "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": 1694466123.9963267, "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": 1694466123.9978254, "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": 1694466123.9978254, "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": 1694466123.9978254, "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": 1694466123.9988236, "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": 1694466123.9988236, "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": 1694466123.9988236, "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": 1694466123.9988236, "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": 1694466123.999822, "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": 1694466123.999822, "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": 1694466123.999822, "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": 1694466123.999822, "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": 1694466124.0008185, "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": 1694466124.0008185, "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": 1694466124.0008185, "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": 1694466124.0018158, "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": 1694466124.0018158, "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": 1694466124.0028117, "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": 1694466124.0028117, "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": 1694466124.0038085, "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": 1694466124.0038085, "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": 1694466124.004805, "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": 1694466124.0060155, "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": 1694466124.0070117, "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": 1694466124.0075154, "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": 1694466124.0085168, "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": 1694466124.0085168, "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": 1694466124.01002, "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": 1694466124.012021, "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": 1694466124.0133932, "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": 1694466124.0133932, "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": 1694466124.0143962, "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": 1694466124.0153975, "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": 1694466124.018899, "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": 1694466124.0209014, "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": 1694466124.0218964, "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": 1694466124.0218964, "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": 1694466124.022893, "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": 1694466124.0238893, "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": 1694466124.0238893, "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": 1694466124.0238893, "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": 1694466124.0248861, "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": 1694466124.0263875, "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": 1694466124.027892, "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": 1694466124.0300355, "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": 1694466124.0310452, "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": 1694466124.0310452, "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": 1694466124.0321398, "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": 1694466124.0332224, "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": 1694466124.0343056, "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": 1694466124.0343056, "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": 1694466124.0343056, "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": 1694466124.035545, "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": 1694466124.035545, "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": 1694466124.035545, "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": 1694466124.035545, "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": 1694466124.035545, "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": 1694466124.0372236, "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": 1694466124.038308, "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": 1694466124.0393825, "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": 1694466124.0393825, "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": 1694466124.0404592, "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": 1694466124.0404592, "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": 1694466124.0415478, "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": 1694466124.0415478, "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": 1694466124.0415478, "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": 1694466124.0415478, "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": 1694466124.043131, "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": 1694466124.043131, "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": 1694466124.043131, "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": 1694466124.0441477, "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": 1694466124.0451443, "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": 1694466124.0451443, "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": 1694466124.0461514, "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": 1694466124.047653, "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": 1694466124.047653, "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": 1694466124.049657, "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": 1694466124.0516608, "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": 1694466124.0516608, "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": 1694466124.053157, "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": 1694466124.0543659, "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": 1694466124.055443, "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": 1694466124.055443, "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": 1694466124.0564582, "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": 1694466124.0574312, "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": 1694466124.0590813, "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": 1694466124.0590813, "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": 1694466124.0607445, "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": 1694466124.0633624, "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": 1694466124.064343, "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": 1694466124.0653405, "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": 1694466124.0653405, "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": 1694466124.0663364, "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": 1694466124.0663364, "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": 1694466124.0673335, "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": 1694466124.067837, "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": 1694466124.067837, "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": 1694466124.067837, "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": 1694466124.067837, "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": 1694466124.0688355, "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": 1694466124.0698333, "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": 1694466124.0698333, "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": 1694466124.07083, "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": 1694466124.0718267, "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": 1694466124.0718267, "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": 1694466124.0728233, "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": 1694466124.0728233, "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": 1694466124.0728233, "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": 1694466124.0738199, "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": 1694466124.0748167, "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": 1694466124.0763183, "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": 1694466124.0773165, "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": 1694466124.0778186, "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": 1694466124.0778186, "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": 1694466124.0778186, "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": 1694466124.0788167, "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": 1694466124.0808115, "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": 1694466124.081808, "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": 1694466124.0828047, "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": 1694466124.0828047, "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": 1694466124.085796, "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": 1694466124.0913334, "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": 1694466124.09233, "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": 1694466124.094827, "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": 1694466124.0958235, "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": 1694466124.0974061, "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": 1694466124.0974061, "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": 1694466124.0974061, "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": 1694466124.0984042, "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": 1694466124.0984042, "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": 1694466124.0994005, "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": 1694466124.0994005, "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": 1694466124.1003988, "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": 1694466124.1003988, "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": 1694466124.1013951, "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": 1694466124.1013951, "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\\eligibility_missing_column_check.sql", "original_file_path": "macros\\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 , '{{ 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": 1694466124.1013951, "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": 1694466124.1023924, "supported_languages": null}, "macro.the_tuva_project.header_duplicate_check": {"name": "header_duplicate_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\header_duplicate_check.sql", "original_file_path": "macros\\header_duplicate_check.sql", "unique_id": "macro.the_tuva_project.header_duplicate_check", "macro_sql": "{% macro 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 , '{{ 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 claim_id\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": 1694466124.1023924, "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": 1694466124.1053817, "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": 1694466124.1063786, "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": 1694466124.1073751, "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 )\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": 1694466124.1088743, "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 {% if headers == true %}\r\n {% do collist.append(col.name ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n {% else %}\r\n {% do collist.append(\"_c\" ~ loop.index0 ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n {% endif %}\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 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)\r\nFILEFORMAT = CSV\r\nPATTERN = '{{ pattern }}*'\r\nFORMAT_OPTIONS (\r\n {% if headers == true %} 'header' = 'true', {% else %} 'header' = 'false', {% 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": 1694466124.112367, "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": 1694466124.112367, "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\\medical_claim_missing_column_check.sql", "original_file_path": "macros\\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 , '{{ 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": 1694466124.1133647, "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\\pharmacy_claim_missing_column_check.sql", "original_file_path": "macros\\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 , '{{ 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": 1694466124.1133647, "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.claims_data_model.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1694466124.116519, "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": 1694466124.116519, "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": 1694466124.116519, "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": 1694466124.117111, "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": 1694466124.1180277, "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": 1694466124.1180277, "supported_languages": null}}, "docs": {"doc.claims_data_model.__the_tuva_project__": {"name": "__the_tuva_project__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__the_tuva_project__", "block_contents": "# \ud83c\udf0e\u00a0The Tuva Project\r\n## \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is messy, and working with it is hard! Analytics teams spend countless hours ingesting, cleaning and transforming healthcare data in order to get it ready for analytics and machine learning. Healthcare knowledge and code are siloed; countless institutions are wasting hours duplicating the same work, and when mistakes are made or issues are missed, the insights gained from the analytics have little value.\r\n\r\nTuva Health is aiming to change that with the launch of The Tuva Project. We're making it easy to get value out of your healthcare data by open sourcing the code needed to transform your data, publishing a knowledgebase of healthcare concepts and artifacts to make it easy to understand and learn about healthcare data, and building an online community of healthcare data professionals to share insights and get help.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/docs/intro)\r\nWe're working towards building a complete knowledgebase of healthcare data concepts, covering everything from getting started with healthcare data through higher level analytics concepts. You can [help contribute](https://thetuvaproject.com/docs/how-to-contribute/edit-github) by adding new pages through github.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/)\r\nWe're open-sourcing code to help transform your healthcare data. Built just import this dbt package, just map your data to our input layer and instantly transform your data into helpful core concepts, get data marts for some of the most common analytics applications, get insights about your data quality and how it changes over time, and easily import some of the most useful healthcare terminology sets into your data warehouse.\r\n\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nStill stuck? Join our slack community of healthcare data professionals and get answers to your healthcare data questions, communicate directly with the engineers working on The Tuva Project, and get the latest updates.\r\n\r\n## \u2049\u00a0What is this package and how do I use it?\r\n\r\nThis is The Tuva Project, a [dbt package](https://docs.getdbt.com/docs/build/packages) that imports all of the packages developed by Tuva Health. Running The Tuva Project is as simple as [mapping](https://thetuvaproject.com/docs/claims-data-warehouse/setup) your data to our input layer, adding the_tuva_project to your packages.yml, and running `dbt deps` and `dbt build`. See our [readme](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) for more detailed setup instructions. If you are new to dbt, check out [their documentation](https://docs.getdbt.com/docs/introduction) for tips on getting started.\r\n\r\nThis package will import the following packages:\r\n- [data_profiling](https://github.com/tuva-health/data_profiling): Runs data quality tests to check for common problems specific to healthcare claims data.\r\n- [claims_preprocessing](https://github.com/tuva-health/claims_preprocessing): Groups overlapping claims into a single encounter, assigns every claim to 1 of 15 different encounter types and populates core concept tables.\r\n- [cms_chronic_conditions](https://github.com/tuva-health/chronic_conditions): Implements a chronic condition grouper based on ICD-10-CM codes. As a result, it is possible to know whether each patient in your population has any of ~70 different chronic conditions defined for the grouper.\r\n- [tuva_chronic_conditions](https://github.com/tuva-health/tuva_chronic_conditions): implements a chronic condition grouper created by the Tuva Project which creates ~40 homogeneous and mutually exclusive chronic condition groups on your patient.\r\n- [pmpm](https://github.com/tuva-health/pmpm): Calculates spend and utilization metrics for your patient population on a per-member-per-month (pmpm) basis.\r\n- [readmissions](https://github.com/tuva-health/readmissions): Calculates hospital readmission measures.\r\n- [terminology](https://github.com/tuva-health/terminology): Makes the latest version of many useful healthcare terminology datasets available as tables in your data warehouse. This package is different from the others because it does not build healthcare concepts on top of your data."}, "doc.claims_data_model.__the_tuva_project_input__": {"name": "__the_tuva_project_input__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__the_tuva_project_input__", "block_contents": "# \ud83e\uddf0\u00a0The Tuva Project Input Layer\r\n\r\nIn order to run The Tuva Project, you will need to start by creating the following 3 models in your dbt project with their appropriate structures:\r\n- [eligibility](https://tuva-health.github.io/the_tuva_project/#!/model/model.the_tuva_project_input.eligibility): A table with eligibility coverage spans for all patients.\r\n- [medical_claim](https://tuva-health.github.io/the_tuva_project/#!/model/model.the_tuva_project_input.medical_claim): A table at the claim line grain housing claim, condition, and procedure information for professional and institutional claims. \r\n- [pharmacy_claim](https://tuva-health.github.io/the_tuva_project/#!/model/model.the_tuva_project_input.pharmacy_claim): A table housing pharmacy claim details.\r\n\r\nFor more detailed instructions and guidance, see our [mapping guide](https://thetuvaproject.com/docs/claims-data-warehouse/setup)"}, "doc.claims_data_model.__readmissions__": {"name": "__readmissions__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__readmissions__", "block_contents": "# \ud83d\udce6\u00a0Readmissions\r\n\r\nHospital Readmissions are when a patient returns to the hospital within 30 days of a previous encounter for the same or a related condition. A hospital's readmission rate is often used to measure quality of care, and [CMS reduces reimbursements](https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/Value-Based-Programs/HRRP/Hospital-Readmission-Reduction-Program) according to an adjustment factor correlated with the readmission measures.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package produces a mart which calculates which encounters are readmissions. It produces the following two main output tables:\r\n\r\n| Table | Definition |\r\n|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [encounter_augmented](#!/model/model.readmissions.readmissions__encounter_augmented#description) | A table at the encounter grain including details about which encounters were flagged for readmissions and other flags indicating why or why not the encounter was flagged |\r\n| [readmission_summary](#!/model/model.readmissions.readmissions__readmission_summary#description) | A table table showing all encounters that were not disqualified for data quality reasons, with flags indicating if the encounter had readmissions and other relevant information |\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Readmissions](https://thetuvaproject.com/docs/analytics/readmissions) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/readmissions/latest/) or [GitHub](https://github.com/tuva-health/readmissions)"}, "doc.claims_data_model.__data_profiling__": {"name": "__data_profiling__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__data_profiling__", "block_contents": "# \ud83d\udce6\u00a0Data Profiling\r\n\r\nData Profiling is the process of examining and analyzing your data to gain insights into its quality. This package runs a variety of tests against the input tables you have mapped in the Claims Data Model that will help identify data quality problems or mapping issues that could affect downstream analytics.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nData Profiling produces 3 detail tables that provide row-level data quality insights for your mapped Claims Data Model models, and a summary table that provides a high level overview into all three tables. \r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\r\n| [summary](#!/model/model.data_profiling.data_profiling__summary#description) | A high level table that summarizes and aggregates the data quality issues in `medical_claim`, `pharmacy_claim`, and `eligibility` |\r\n| [test_detail](#!/model/model.data_profiling.data_profiling__test_detail#description) | A table detailing every failed claim or eligibility record with details on the tests that failed and links back to the source table |\r\n| [test_results](#!/model/model.data_profiling.data_profiling__test_results#description) | A table that shows pass/fail counts and percentages for every test on every input table |\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Data Profiling](https://thetuvaproject.com/docs/analytics/data-profiling) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/data_profiling/latest/) or [GitHub](https://github.com/tuva-health/data_profiling)"}, "doc.claims_data_model.__claims_preprocessing__": {"name": "__claims_preprocessing__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__claims_preprocessing__", "block_contents": "# \ud83d\udce6\u00a0Claims Preprocessing\r\n\r\nClaims data in its raw form is not built with analytics in mind. This package takes the Claims Data Model tables you have created, and produces tables more readily built for analytics. It also groups claims into encounters, and infers an encounter type based on the data in the claims.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package produces the core schema, which enhances the Claims Data Model and together serve as the fundamental building blocks other packages in The Tuva Project build upon. \r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\r\n| [condition](#!/model/model.claims_preprocessing.claims_preprocessing__condition#description) | A table containing all conditions diagnosed in the claims data |\r\n| [encounter](#!/model/model.claims_preprocessing.claims_preprocessing__encounter#description) | A table containing all encounters and encounter types identified in the claims data |\r\n| [patient](#!/model/model.claims_preprocessing.claims_preprocessing__patient#description) | A table containing all patients present in the enrollment data |\r\n| [prescription](#!/model/model.claims_preprocessing.claims_preprocessing__prescription#description) | A table containing all medications prescribed to a patient |\r\n| [procedure](#!/model/model.claims_preprocessing.claims_preprocessing__procedure#description) | A table containing all procedures performed on a patient in the claims data |\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/claims_preprocessing/latest/) or [GitHub](https://github.com/tuva-health/claims_preprocessing)"}, "doc.claims_data_model.__terminology__": {"name": "__terminology__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__terminology__", "block_contents": "# \ud83d\udce6\u00a0Terminology\r\n\r\nClaims data utilizes numerous code sets to convey critical information, but generally does not include human readable descriptions of those codes. The Terminology Package provides an easy way of loading those dictionaries as well as common mappings and groupers, so you can get more meaningful insight into your data.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package loads numerous healthcare terminology sets into your warehouse. Please navigate the project tree in these docs for more information, or see [github](https://github.com/tuva-health/terminology/tree/main/terminology) for the raw list of files and their contents.\r\n\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/terminology/latest/) or [GitHub](https://github.com/tuva-health/terminology)"}, "doc.claims_data_model.__cms_chronic_conditions__": {"name": "__cms_chronic_conditions__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__cms_chronic_conditions__", "block_contents": "# \ud83d\udce6\u00a0CMS Chronic Conditions\r\n\r\nThe OEDA and CMS have develeoped a [set of information products and analytics](https://www.cms.gov/Research-Statistics-Data-and-Systems/Statistics-Trends-and-Reports/Chronic-Conditions) examining chronic conditions among Medicare beneficiaries. Identifying patients with chronic conditions will help provide an understanding of the burden and implications for the healthcare system, help identify high-risk patients, and help inform about resource utilization of patients with chronic diseases.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package calculates which patients have chronic conditions per the CMS methodological standards, and produces that information in two tables at the patient grain and at the patient-condition grain\r\n\r\n| Table | Definition |\r\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [chronic_conditions_pivoted](#!/model/model.cms_chronic_conditions.cms_chronic_conditions__chronic_conditions_pivoted#description) | A table at the patient grain, with a row for each patient and a column for each chronic condition and a flag indicating if they have that condition |\r\n| [chronic_conditions_unioned](#!/model/model.cms_chronic_conditions.cms_chronic_conditions__chronic_conditions_unioned#description) | A table at the patient-condition grain, with a row for every chronic condition identified in the data |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Chronic Conditions](https://thetuvaproject.com/docs/analytics/chronic-conditions) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/cms_chronic_conditions/latest/) or [GitHub](https://github.com/tuva-health/cms_chronic_conditions)"}, "doc.claims_data_model.__tuva_chronic_conditions__": {"name": "__tuva_chronic_conditions__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__tuva_chronic_conditions__", "block_contents": "# \ud83d\udce6\u00a0Tuva Chronic Conditions\r\n\r\nIdentifying patients with chronic conditions will help provide an understanding of the burden and implications for the healthcare system, help identify high-risk patients, and help inform about resource utilization of patients with chronic diseases.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package calculates which patients have chronic conditions, and produces that information in two tables at the patient grain and at the patient-condition grain, and provides a table for grouping conditions into condition families.\r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [chronic_condition_groups](#!/model/model.tuva_chronic_conditions.tuva_chronic_conditions__chronic_condition_groups#description) | A table with mappings between all of the chronic conditions and their logical condition families |\r\n| [chronic_conditions_long](#!/model/model.tuva_chronic_conditions.tuva_chronic_conditions__chronic_conditions_long#description) | A table at the patient-condition grain, with a row for every chronic condition identified in the data |\r\n| [chronic_conditions_wide](#!/model/model.tuva_chronic_conditions.tuva_chronic_conditions__chronic_conditions_wide#description) | A table at the patient grain, with a row for each patient and a column for each chronic condition and a flag indicating if they have that condition |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- [Learn more about Chronic Conditions](https://thetuvaproject.com/docs/analytics/chronic-conditions) at the Tuva Project\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/tuva_chronic_conditions/latest/) or [GitHub](https://github.com/tuva-health/tuva_chronic_conditions)"}, "doc.claims_data_model.__pmpm__": {"name": "__pmpm__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__pmpm__", "block_contents": "# \ud83d\udce6\u00a0PMPM\r\n\r\nPMPM (cost per member per month) is a common healthcare financial benchmark, which calculates the average cost of healthcare per member enrolled per month. \r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What does this package produce?\r\n\r\nThis package produces one table, whcih can be used to build PMPM calculations and perform related analytics\r\n\r\n| Table | Definition |\r\n|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\r\n| [pmpm_builder](#!/model/model.pmpm.pmpm__pmpm_builder#description) | A table at the patient-month grain, with a row for month every patient has coverage, and the total and detailed spend for that month |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)\r\n- Find this repo on [dbt hub](https://hub.getdbt.com/tuva-health/pmpm/latest/) or [GitHub](https://github.com/tuva-health/pmpm)"}, "doc.claims_data_model.__claims_data_model__": {"name": "__claims_data_model__", "resource_type": "doc", "package_name": "claims_data_model", "path": "docs_blocks.md", "original_file_path": "docs\\docs_blocks.md", "unique_id": "doc.claims_data_model.__claims_data_model__", "block_contents": "# \ud83d\udce6\u00a0Claims Data Model\r\n\r\nThe first step to using The Tuva Project is to map your claims data to the Claims Data Model. The Tuva Project expects your project to have three models containing your [medical_claim](#!/model/model.claims_data_model.medical_claim#description), [pharmacy_claim](#!/model/model.claims_data_model.pharmacy_claim#description), and [eligibiilty](#!/model/model.claims_data_model.eligibility#description) data in the expected format. All packages in The Tuva Project ecosystem run off of these core tables.\r\n\r\n### \ud83d\udca1\u00a0Tips for getting started:\r\n- Read through our [Mappping Guide](https://thetuvaproject.com/docs/claims-data-warehouse/setup) for tips on how to map the models.\r\n- Check out the [Tuva Project Readme](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) for more details on how to get started with the tuva project.\r\n- Use the [Data Profiling](#!/overview/readmissions) package to validate your models, and make sure there aren't any issues that would affect downstream packages or analytics.\r\n\r\n\u00a0\u00a0\r\n\r\n\r\n### \ud83d\udcca\u00a0What models do I need to build in order for The Tuva Project to run?\r\n\r\nCreate the following models in your dbt project:\r\n\r\n| Table | Definition |\r\n|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| [eligibility](#!/model/model.claims_data_model.eligibility#description) | A model detailing eligibility spans for all patients in your population |\r\n| [medical_claim](#!/model/model.claims_data_model.medical_claim#description) | A model containing all of the claim-line level information from your claims including claim type, provider info, charge/payment info, conditions, and procedures |\r\n| [pharmacy_claim](#!/model/model.claims_data_model.pharmacy_claim#description) | A model containing all of the medications prescribed and administered in pharmacy claims |\r\n\u00a0\u00a0\r\n\r\n\u00a0\u00a0\r\n\r\n---\r\n### \ud83d\udd17\u00a0Quick Links\r\n- Read the [Mapping Guide](https://thetuvaproject.com/docs/claims-data-warehouse/setup), for more info on how to get started\r\n- Discover more about [The Tuva Project](https://thetuvaproject.com/), or the parent company [Tuva Health](https://tuvahealth.com/)\r\n- Find The Tuva Project on [dbt hub](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) or [GitHub](https://github.com/tuva-health/the_tuva_project)"}, "doc.claims_data_model.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "claims_data_model", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.claims_data_model.__overview__", "block_contents": "# \ud83c\udf0e\u00a0The Tuva Project\r\n## \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is messy, and working with it is hard! Analytics teams spend countless hours ingesting, cleaning and transforming healthcare data in order to get it ready for analytics and machine learning. Healthcare knowledge and code are siloed; countless institutions are wasting hours duplicating the same work, and when mistakes are made or issues are missed, the insights gained from the analytics have little value.\r\n\r\nTuva Health is aiming to change that with the launch of The Tuva Project. We're making it easy to get value out of your healthcare data by open sourcing the code needed to transform your data, publishing a knowledgebase of healthcare concepts and artifacts to make it easy to understand and learn about healthcare data, and building an online community of healthcare data professionals to share insights and get help.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/docs/intro)\r\nWe're working towards building a complete knowledgebase of healthcare data concepts, covering everything from getting started with healthcare data through higher level analytics concepts. You can [help contribute](https://thetuvaproject.com/docs/how-to-contribute/edit-github) by adding new pages through github.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/)\r\nWe're open-sourcing code to help transform your healthcare data. Built just import this dbt package, just map your data to our input layer and instantly transform your data into helpful core concepts, get data marts for some of the most common analytics applications, get insights about your data quality and how it changes over time, and easily import some of the most useful healthcare terminology sets into your data warehouse.\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nStill stuck? Join our slack community of healthcare data professionals and get answers to your healthcare data questions, communicate directly with the engineers working on The Tuva Project, and get the latest updates.\r\n\r\n## \u2049\u00a0What is this package and how do I use it?\r\n\r\nThis is The Tuva Project, a [dbt package](https://docs.getdbt.com/docs/build/packages) that imports all of the packages developed by Tuva Health. Running The Tuva Project is as simple as [mapping](https://thetuvaproject.com/docs/claims-data-warehouse/setup) your data to our input layer, adding the_tuva_project to your packages.yml, and running `dbt deps` and `dbt build`. See our [readme](https://hub.getdbt.com/tuva-health/the_tuva_project/latest/) for more detailed setup instructions. If you are new to dbt, check out [their documentation](https://docs.getdbt.com/docs/introduction) for tips on getting started.\r\n\r\nThis package will import the following packages:\r\n- [data_profiling](https://github.com/tuva-health/data_profiling): Runs data quality tests to check for common problems specific to healthcare claims data.\r\n- [claims_preprocessing](https://github.com/tuva-health/claims_preprocessing): Groups overlapping claims into a single encounter, assigns every claim to 1 of 15 different encounter types and populates core concept tables.\r\n- [cms_chronic_conditions](https://github.com/tuva-health/chronic_conditions): Implements a chronic condition grouper based on ICD-10-CM codes. As a result, it is possible to know whether each patient in your population has any of ~70 different chronic conditions defined for the grouper.\r\n- [tuva_chronic_conditions](https://github.com/tuva-health/tuva_chronic_conditions): implements a chronic condition grouper created by the Tuva Project which creates ~40 homogeneous and mutually exclusive chronic condition groups on your patient.\r\n- [pmpm](https://github.com/tuva-health/pmpm): Calculates spend and utilization metrics for your patient population on a per-member-per-month (pmpm) basis.\r\n- [readmissions](https://github.com/tuva-health/readmissions): Calculates hospital readmission measures.\r\n- [terminology](https://github.com/tuva-health/terminology): Makes the latest version of many useful healthcare terminology datasets available as tables in your data warehouse. This package is different from the others because it does not build healthcare concepts on top of your 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": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.claims_data_model.condition": [], "model.claims_data_model.eligibility": [], "model.claims_data_model.encounter": [], "model.claims_data_model.lab_result": [], "model.claims_data_model.location": [], "model.claims_data_model.medical_claim": [], "model.claims_data_model.medication": [], "model.claims_data_model.observation": [], "model.claims_data_model.patient": [], "model.claims_data_model.pharmacy_claim": [], "model.claims_data_model.practitioner": [], "model.claims_data_model.procedure": [], "seed.claims_data_model.eligibility_seed": [], "seed.claims_data_model.medical_claim_seed": [], "seed.claims_data_model.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__wide_condition_category": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__wide_procedure_category": ["model.the_tuva_project.ccsr__long_procedure_category", "model.the_tuva_project.ccsr__procedure_category_map"], "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", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"], "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.claims_data_model.medical_claim"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.claims_data_model.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.acute_inpatient__summary": ["model.claims_data_model.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__institutional_encounter_id", "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__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__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__institutional_claims": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_claims"], "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__service_category_grouper"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.claims_data_model.eligibility"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.claims_date_profiling__date_issues": ["model.claims_data_model.eligibility", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.claims_date_profiling__date_summary": ["model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__medical_claim_dates", "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates"], "model.the_tuva_project.claims_date_profiling__duplicate_dates": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.claims_date_profiling__medical_claim_dates": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": ["model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.data_profiling__summary": ["model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_detail": ["model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__test_result": ["model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__use_case": ["model.claims_data_model.eligibility", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.pharmacy_claim", "model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__claim_type_mapping_failures": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__claim_type_unmapped": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__eligibility_denominators": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__eligibility_duplicates": ["model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__eligibility_invalid_values": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "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_profiling__eligibility_missing_values": ["model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__eligibility_plausibility": ["model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility", "model.claims_data_model.eligibility"], "model.the_tuva_project.data_profiling__institutional_header_failures": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__institutional_header_fail_details": ["model.the_tuva_project.data_profiling__institutional_header_failures"], "model.the_tuva_project.data_profiling__medical_claim_denominators": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_duplicates": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_invalid_values": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.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__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_profiling__medical_claim_plausibility": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": ["model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": ["model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": ["model.claims_data_model.pharmacy_claim"], "model.the_tuva_project.data_profiling__professional_header_failures": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim"], "model.the_tuva_project.data_profiling__professional_header_fail_details": ["model.the_tuva_project.data_profiling__professional_header_failures"], "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": ["model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_plausibility"], "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": ["model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_plausibility", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__professional_header_fail_details"], "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"], "model.the_tuva_project.data_profiling__test_result_stage_eligibility": ["model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": ["model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": ["model.claims_data_model.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"], "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__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__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__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__emergency_department_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__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.claims_data_model.medical_claim"], "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_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_eligibility"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_hcc__stg_eligibility": ["model.claims_data_model.eligibility"], "model.the_tuva_project.cms_hcc__stg_medical_claim": ["model.claims_data_model.medical_claim"], "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.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "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.claims_data_model.eligibility"], "model.the_tuva_project.core__stg_claims_encounter": ["model.the_tuva_project.acute_inpatient__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", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.core__stg_claims_patient": ["model.claims_data_model.eligibility"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.claims_data_model.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", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_procedure": ["model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.claims_data_model.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.core__stg_clinical_condition": ["model.claims_data_model.condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.claims_data_model.encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.claims_data_model.lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.claims_data_model.location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.claims_data_model.medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.claims_data_model.observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.claims_data_model.patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.claims_data_model.practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.claims_data_model.procedure"], "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": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["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__stg_member_months"], "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_member_months": ["model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_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_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_nqf2372_denominator": ["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__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness": ["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", "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_dementia": ["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__medication", "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", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": ["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_exclude_institutional": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim"], "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_exclude_palliative": ["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_exclusions": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative"], "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__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__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.claims_data_model.medical_claim"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.claims_data_model.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__diagnosis": ["model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.readmissions__diagnosis_ccs": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__primary_diagnosis_count", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "seed.the_tuva_project.terminology__icd_10_cm"], "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__diagnosis_ccs", "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__primary_diagnosis_count", "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__diagnosis_ccs", "model.the_tuva_project.readmissions__encounter", "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__exclusion": ["model.the_tuva_project.readmissions__diagnosis_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__diagnosis_ccs", "model.the_tuva_project.readmissions__diagnosis_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__primary_diagnosis_count": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__diagnosis"], "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__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": ["model.the_tuva_project.quality_measures__summary_counts"], "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": ["model.the_tuva_project.quality_measures__summary_long"], "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__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": [], "seed.the_tuva_project.terminology__medicare_status": [], "seed.the_tuva_project.terminology__ms_drg": [], "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__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.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_profiling__test_catalog": [], "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.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_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.1e7ac0d681": ["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_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384": ["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.47cbdf864b": ["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.claims_data_model.condition": ["model.the_tuva_project.core__stg_clinical_condition"], "model.claims_data_model.eligibility": ["model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__date_issues", "model.the_tuva_project.cms_hcc__stg_eligibility", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__eligibility_plausibility", "model.the_tuva_project.data_profiling__use_case"], "model.claims_data_model.encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.claims_data_model.lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "model.claims_data_model.location": ["model.the_tuva_project.core__stg_clinical_location"], "model.claims_data_model.medical_claim": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__date_issues", "model.the_tuva_project.claims_date_profiling__date_issues", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__medical_claim_dates", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_hcc__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.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__institutional_header_failures", "model.the_tuva_project.data_profiling__institutional_header_failures", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_plausibility", "model.the_tuva_project.data_profiling__medical_claim_plausibility", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__professional_header_failures", "model.the_tuva_project.data_profiling__professional_header_failures", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"], "model.claims_data_model.medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.claims_data_model.observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.claims_data_model.patient": ["model.the_tuva_project.core__stg_clinical_patient"], "model.claims_data_model.pharmacy_claim": ["model.the_tuva_project.claims_date_profiling__claims_without_enrollment", "model.the_tuva_project.claims_date_profiling__duplicate_dates", "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.core__stg_claims_pharmacy_claim", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"], "model.claims_data_model.practitioner": ["model.the_tuva_project.core__stg_clinical_practitioner"], "model.claims_data_model.procedure": ["model.the_tuva_project.core__stg_clinical_procedure"], "seed.claims_data_model.eligibility_seed": [], "seed.claims_data_model.medical_claim_seed": [], "seed.claims_data_model.pharmacy_claim_seed": [], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__singular_condition_category", "model.the_tuva_project.ccsr__wide_condition_category"], "model.the_tuva_project.ccsr__long_procedure_category": ["model.the_tuva_project.ccsr__wide_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__wide_condition_category": [], "model.the_tuva_project.ccsr__wide_procedure_category": [], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["model.the_tuva_project.ccsr__long_condition_category", "model.the_tuva_project.ccsr__wide_condition_category"], "model.the_tuva_project.ccsr__procedure_category_map": ["model.the_tuva_project.ccsr__long_procedure_category", "model.the_tuva_project.ccsr__wide_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", "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.chronic_conditions__tuva_chronic_conditions_wide"], "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.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_procedure"], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "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_medical_claim"], "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__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__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__institutional_claims", "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__service_category_grouper": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.claims_date_profiling__claims_without_enrollment": [], "model.the_tuva_project.claims_date_profiling__date_issues": [], "model.the_tuva_project.claims_date_profiling__date_summary": [], "model.the_tuva_project.claims_date_profiling__duplicate_dates": ["model.the_tuva_project.claims_date_profiling__date_summary"], "model.the_tuva_project.claims_date_profiling__medical_claim_dates": ["model.the_tuva_project.claims_date_profiling__date_summary"], "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates": ["model.the_tuva_project.claims_date_profiling__date_summary"], "model.the_tuva_project.data_profiling__summary": [], "model.the_tuva_project.data_profiling__test_detail": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case", "model.the_tuva_project.data_profiling__use_case"], "model.the_tuva_project.data_profiling__test_result": [], "model.the_tuva_project.data_profiling__use_case": [], "model.the_tuva_project.data_profiling__claim_type_mapping_failures": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__claim_type_unmapped": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__eligibility_denominators": ["model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_duplicates": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_invalid_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__eligibility_plausibility": ["model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "model.the_tuva_project.data_profiling__institutional_header_failures": ["model.the_tuva_project.data_profiling__institutional_header_fail_details"], "model.the_tuva_project.data_profiling__institutional_header_fail_details": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_denominators": ["model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_duplicates": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_invalid_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_plausibility": ["model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_profiling__professional_header_failures": ["model.the_tuva_project.data_profiling__professional_header_fail_details"], "model.the_tuva_project.data_profiling__professional_header_fail_details": ["model.the_tuva_project.data_profiling__summary", "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"], "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": ["model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": ["model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.data_profiling__test_result_stage_eligibility": ["model.the_tuva_project.data_profiling__test_result"], "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": ["model.the_tuva_project.data_profiling__test_result"], "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__test_result"], "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__service_category_grouper", "model.the_tuva_project.core__stg_claims_medical_claim"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__combined_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__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__home_health_professional", "model.the_tuva_project.service_category__skilled_nursing_professional"], "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__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__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.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__patient_risk_scores", "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot", "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.1e7ac0d681"], "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_eligibility": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__stg_medical_claim": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "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.quality_measures__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.financial_pmpm__stg_eligibility"], "model.the_tuva_project.core__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.core__location": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.readmissions__stg_core__medical_claim"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.quality_measures__stg_core__medication"], "model.the_tuva_project.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.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.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"], "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.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_member_months"], "model.the_tuva_project.financial_pmpm__pmpm": [], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__pmpm", "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384"], "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_member_months": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.quality_measures__summary_counts": ["snapshot.the_tuva_project.quality_measures__summary_counts_snapshot"], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__summary_counts", "model.the_tuva_project.quality_measures__summary_wide", "snapshot.the_tuva_project.quality_measures__summary_long_snapshot"], "model.the_tuva_project.quality_measures__summary_wide": [], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "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_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "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_exclude_palliative": ["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__stg_core__condition": ["model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "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_nqf2372_denominator", "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.quality_measures__int_nqf2372_exclude_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_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "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_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_long", "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b", "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_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "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_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures__int_nqf2372_numerator"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.quality_measures__int_nqf2372_exclude_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__diagnosis": ["model.the_tuva_project.readmissions__diagnosis_ccs", "model.the_tuva_project.readmissions__primary_diagnosis_count", "model.the_tuva_project.readmissions__primary_diagnosis_count"], "model.the_tuva_project.readmissions__diagnosis_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__encounter": ["model.the_tuva_project.readmissions__encounter_augmented", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "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__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__primary_diagnosis_count": ["model.the_tuva_project.readmissions__diagnosis_ccs", "model.the_tuva_project.readmissions__encounter_data_quality"], "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__diagnosis"], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.readmissions__diagnosis", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__stg_core__medical_claim": [], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.readmissions__procedure_ccs"], "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": [], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": [], "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": [], "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": [], "seed.the_tuva_project.terminology__admit_source": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values"], "seed.the_tuva_project.terminology__admit_type": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values"], "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_profiling__medical_claim_invalid_values", "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_profiling__medical_claim_invalid_values", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__calendar": ["model.the_tuva_project.financial_pmpm__member_months"], "seed.the_tuva_project.terminology__claim_type": ["model.the_tuva_project.data_profiling__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_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values"], "seed.the_tuva_project.terminology__discharge_disposition": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "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_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__hcpcs_level_2": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__icd_10_cm": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.readmissions__diagnosis_ccs"], "seed.the_tuva_project.terminology__icd_10_pcs": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__icd_9_cm": [], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_status": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__ms_drg": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "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__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__payer_type": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__place_of_service": ["model.the_tuva_project.data_profiling__medical_claim_invalid_values", "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_profiling__medical_claim_invalid_values"], "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"], "seed.the_tuva_project.terminology__race": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__revenue_center": ["model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.service_category__dq_input_layer_tests"], "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": ["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"], "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_profiling__test_catalog": [], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator"], "seed.the_tuva_project.quality_measures__value_sets": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "model.the_tuva_project.quality_measures__int_nqf2372_numerator"], "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__diagnosis_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.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_cms_hcc__patient_risk_scores_patient_id.05b154e126": [], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": [], "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_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384": [], "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.47cbdf864b": [], "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": []}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index e00d55528..8f2e43162 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.4.5", "generated_at": "2023-09-05T20:46:45.978497Z", "invocation_id": "b330cbb2-d728-4604-a8cc-149d73befad1", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.297948Z", "completed_at": "2023-09-05T20:45:36.307752Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.329817Z", "completed_at": "2023-09-05T20:45:36.739907Z"}], "thread_id": "Thread-28", "execution_time": 0.5323987007141113, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e1830185619a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.305750Z", "completed_at": "2023-09-05T20:45:36.309272Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.347519Z", "completed_at": "2023-09-05T20:45:36.768737Z"}], "thread_id": "Thread-34", "execution_time": 0.5737640857696533, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552a2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.289930Z", "completed_at": "2023-09-05T20:45:36.305750Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.309272Z", "completed_at": "2023-09-05T20:45:36.789045Z"}], "thread_id": "Thread-31", "execution_time": 0.5979599952697754, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e1830185619e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.298463Z", "completed_at": "2023-09-05T20:45:36.309272Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.338977Z", "completed_at": "2023-09-05T20:45:36.807459Z"}], "thread_id": "Thread-30", "execution_time": 0.6199195384979248, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552aa"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.298463Z", "completed_at": "2023-09-05T20:45:36.309272Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.338977Z", "completed_at": "2023-09-05T20:45:36.799798Z"}], "thread_id": "Thread-33", "execution_time": 0.621013879776001, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e183018561a2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.298463Z", "completed_at": "2023-09-05T20:45:36.308258Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.329817Z", "completed_at": "2023-09-05T20:45:36.827933Z"}], "thread_id": "Thread-29", "execution_time": 0.6397500038146973, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552b2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.298463Z", "completed_at": "2023-09-05T20:45:36.309272Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.329817Z", "completed_at": "2023-09-05T20:45:36.831789Z"}], "thread_id": "Thread-27", "execution_time": 0.654965877532959, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552ae"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.298463Z", "completed_at": "2023-09-05T20:45:36.309272Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.338977Z", "completed_at": "2023-09-05T20:45:36.943829Z"}], "thread_id": "Thread-32", "execution_time": 0.7590906620025635, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552a6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.839691Z", "completed_at": "2023-09-05T20:45:36.839691Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.839691Z", "completed_at": "2023-09-05T20:45:37.288497Z"}], "thread_id": "Thread-28", "execution_time": 0.5433127880096436, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e183018561ae"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.868202Z", "completed_at": "2023-09-05T20:45:36.868202Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.868202Z", "completed_at": "2023-09-05T20:45:37.289822Z"}], "thread_id": "Thread-34", "execution_time": 0.5317952632904053, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e183018561b2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.889001Z", "completed_at": "2023-09-05T20:45:36.889001Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.895009Z", "completed_at": "2023-09-05T20:45:37.322071Z"}], "thread_id": "Thread-31", "execution_time": 0.5393755435943604, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552c2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.917450Z", "completed_at": "2023-09-05T20:45:36.927001Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.948338Z", "completed_at": "2023-09-05T20:45:37.524689Z"}], "thread_id": "Thread-30", "execution_time": 0.7173502445220947, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e183018552ca"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.claims_data_model.procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.918474Z", "completed_at": "2023-09-05T20:45:36.918474Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.918474Z", "completed_at": "2023-09-05T20:45:37.721991Z"}], "thread_id": "Thread-33", "execution_time": 0.9020767211914062, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.claims_data_model.eligibility_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.959092Z", "completed_at": "2023-09-05T20:45:36.959092Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.959092Z", "completed_at": "2023-09-05T20:45:37.808383Z"}], "thread_id": "Thread-29", "execution_time": 0.9629790782928467, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.claims_data_model.medical_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:36.959092Z", "completed_at": "2023-09-05T20:45:36.959092Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:36.969618Z", "completed_at": "2023-09-05T20:45:37.800189Z"}], "thread_id": "Thread-27", "execution_time": 0.9684948921203613, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.claims_data_model.pharmacy_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.049151Z", "completed_at": "2023-09-05T20:45:37.049151Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.049151Z", "completed_at": "2023-09-05T20:45:40.234255Z"}], "thread_id": "Thread-32", "execution_time": 3.488349199295044, "adapter_response": {"_message": "INSERT 22", "code": "INSERT", "rows_affected": 22}, "message": "INSERT 22", "failures": null, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.405502Z", "completed_at": "2023-09-05T20:45:37.405502Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.405502Z", "completed_at": "2023-09-05T20:45:40.059269Z"}], "thread_id": "Thread-34", "execution_time": 3.232896566390991, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.388662Z", "completed_at": "2023-09-05T20:45:37.388662Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.388662Z", "completed_at": "2023-09-05T20:45:40.360587Z"}], "thread_id": "Thread-28", "execution_time": 3.616708993911743, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.633665Z", "completed_at": "2023-09-05T20:45:37.633665Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.633665Z", "completed_at": "2023-09-05T20:45:41.008574Z"}], "thread_id": "Thread-30", "execution_time": 3.525751829147339, "adapter_response": {"_message": "INSERT 1583", "code": "INSERT", "rows_affected": 1583}, "message": "INSERT 1583", "failures": null, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.822039Z", "completed_at": "2023-09-05T20:45:37.822039Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.823544Z", "completed_at": "2023-09-05T20:45:41.257361Z"}], "thread_id": "Thread-33", "execution_time": 3.55561900138855, "adapter_response": {"_message": "INSERT 6", "code": "INSERT", "rows_affected": 6}, "message": "INSERT 6", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.938864Z", "completed_at": "2023-09-05T20:45:37.938864Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:38.064460Z", "completed_at": "2023-09-05T20:45:41.328322Z"}], "thread_id": "Thread-27", "execution_time": 3.491990804672241, "adapter_response": {"_message": "INSERT 424", "code": "INSERT", "rows_affected": 424}, "message": "INSERT 424", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:41.069344Z", "completed_at": "2023-09-05T20:45:41.069344Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:41.071889Z", "completed_at": "2023-09-05T20:45:44.208375Z"}], "thread_id": "Thread-32", "execution_time": 3.3947110176086426, "adapter_response": {"_message": "INSERT 8", "code": "INSERT", "rows_affected": 8}, "message": "INSERT 8", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:41.161448Z", "completed_at": "2023-09-05T20:45:41.161448Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:41.161448Z", "completed_at": "2023-09-05T20:45:44.293313Z"}], "thread_id": "Thread-30", "execution_time": 3.2981345653533936, "adapter_response": {"_message": "INSERT 223", "code": "INSERT", "rows_affected": 223}, "message": "INSERT 223", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:41.090028Z", "completed_at": "2023-09-05T20:45:41.090028Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:41.090028Z", "completed_at": "2023-09-05T20:45:44.362677Z"}], "thread_id": "Thread-28", "execution_time": 3.3837478160858154, "adapter_response": {"_message": "INSERT 72", "code": "INSERT", "rows_affected": 72}, "message": "INSERT 72", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.429418Z", "completed_at": "2023-09-05T20:45:37.429418Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.429418Z", "completed_at": "2023-09-05T20:45:44.488638Z"}], "thread_id": "Thread-31", "execution_time": 7.162200927734375, "adapter_response": {"_message": "INSERT 6532", "code": "INSERT", "rows_affected": 6532}, "message": "INSERT 6532", "failures": null, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:41.378258Z", "completed_at": "2023-09-05T20:45:41.378258Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:41.378258Z", "completed_at": "2023-09-05T20:45:44.488638Z"}], "thread_id": "Thread-33", "execution_time": 3.22218918800354, "adapter_response": {"_message": "INSERT 7", "code": "INSERT", "rows_affected": 7}, "message": "INSERT 7", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:41.071889Z", "completed_at": "2023-09-05T20:45:41.071889Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:41.082656Z", "completed_at": "2023-09-05T20:45:44.505704Z"}], "thread_id": "Thread-34", "execution_time": 3.5407633781433105, "adapter_response": {"_message": "INSERT 580", "code": "INSERT", "rows_affected": 580}, "message": "INSERT 580", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:44.469755Z", "completed_at": "2023-09-05T20:45:44.469755Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:44.472257Z", "completed_at": "2023-09-05T20:45:47.086465Z"}], "thread_id": "Thread-30", "execution_time": 3.0618605613708496, "adapter_response": {"_message": "INSERT 242", "code": "INSERT", "rows_affected": 242}, "message": "INSERT 242", "failures": null, "unique_id": "seed.the_tuva_project.data_profiling__test_catalog"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:44.468175Z", "completed_at": "2023-09-05T20:45:44.468175Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:44.469755Z", "completed_at": "2023-09-05T20:45:47.389016Z"}], "thread_id": "Thread-32", "execution_time": 3.1271800994873047, "adapter_response": {"_message": "INSERT 36", "code": "INSERT", "rows_affected": 36}, "message": "INSERT 36", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:44.709792Z", "completed_at": "2023-09-05T20:45:44.709792Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:44.740060Z", "completed_at": "2023-09-05T20:45:47.549673Z"}], "thread_id": "Thread-34", "execution_time": 2.9749343395233154, "adapter_response": {"_message": "INSERT 80", "code": "INSERT", "rows_affected": 80}, "message": "INSERT 80", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:44.708242Z", "completed_at": "2023-09-05T20:45:44.708242Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:44.722317Z", "completed_at": "2023-09-05T20:45:47.648347Z"}], "thread_id": "Thread-33", "execution_time": 3.0345468521118164, "adapter_response": {"_message": "INSERT 4101", "code": "INSERT", "rows_affected": 4101}, "message": "INSERT 4101", "failures": null, "unique_id": "seed.the_tuva_project.quality_measures_reporting__value_sets"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:44.707726Z", "completed_at": "2023-09-05T20:45:44.707726Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:44.709792Z", "completed_at": "2023-09-05T20:45:47.732642Z"}], "thread_id": "Thread-31", "execution_time": 3.133997917175293, "adapter_response": {"_message": "INSERT 1", "code": "INSERT", "rows_affected": 1}, "message": "INSERT 1", "failures": null, "unique_id": "seed.the_tuva_project.quality_measures_reporting__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:44.705219Z", "completed_at": "2023-09-05T20:45:44.705219Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:44.709792Z", "completed_at": "2023-09-05T20:45:47.789816Z"}], "thread_id": "Thread-28", "execution_time": 3.2001795768737793, "adapter_response": {"_message": "INSERT 36", "code": "INSERT", "rows_affected": 36}, "message": "INSERT 36", "failures": null, "unique_id": "seed.the_tuva_project.quality_measures_reporting__concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:47.598607Z", "completed_at": "2023-09-05T20:45:47.598607Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:47.598607Z", "completed_at": "2023-09-05T20:45:49.360300Z"}], "thread_id": "Thread-32", "execution_time": 1.899935245513916, "adapter_response": {"_message": "INSERT 2", "code": "INSERT", "rows_affected": 2}, "message": "INSERT 2", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:47.688730Z", "completed_at": "2023-09-05T20:45:47.688730Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:47.688730Z", "completed_at": "2023-09-05T20:45:50.051390Z"}], "thread_id": "Thread-34", "execution_time": 2.889943838119507, "adapter_response": {"_message": "INSERT 3", "code": "INSERT", "rows_affected": 3}, "message": "INSERT 3", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:47.748298Z", "completed_at": "2023-09-05T20:45:47.748298Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:47.750809Z", "completed_at": "2023-09-05T20:45:50.179519Z"}], "thread_id": "Thread-33", "execution_time": 2.9613661766052246, "adapter_response": {"_message": "INSERT 47", "code": "INSERT", "rows_affected": 47}, "message": "INSERT 47", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:47.849558Z", "completed_at": "2023-09-05T20:45:47.849558Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:47.849558Z", "completed_at": "2023-09-05T20:45:50.568335Z"}], "thread_id": "Thread-31", "execution_time": 2.9011404514312744, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:47.905624Z", "completed_at": "2023-09-05T20:45:47.905624Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:47.905624Z", "completed_at": "2023-09-05T20:45:50.579680Z"}], "thread_id": "Thread-28", "execution_time": 2.8498926162719727, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:37.938356Z", "completed_at": "2023-09-05T20:45:37.938356Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:37.938864Z", "completed_at": "2023-09-05T20:45:50.579680Z"}], "thread_id": "Thread-29", "execution_time": 12.849867582321167, "adapter_response": {"_message": "INSERT 32741", "code": "INSERT", "rows_affected": 32741}, "message": "INSERT 32741", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:49.501066Z", "completed_at": "2023-09-05T20:45:49.501066Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:49.501066Z", "completed_at": "2023-09-05T20:45:52.059502Z"}], "thread_id": "Thread-32", "execution_time": 2.9167044162750244, "adapter_response": {"_message": "INSERT 65", "code": "INSERT", "rows_affected": 65}, "message": "INSERT 65", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:47.538614Z", "completed_at": "2023-09-05T20:45:47.538614Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:47.538614Z", "completed_at": "2023-09-05T20:45:52.358738Z"}], "thread_id": "Thread-30", "execution_time": 4.933512210845947, "adapter_response": {"_message": "INSERT 12333", "code": "INSERT", "rows_affected": 12333}, "message": "INSERT 12333", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:50.795692Z", "completed_at": "2023-09-05T20:45:50.795692Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:50.795692Z", "completed_at": "2023-09-05T20:45:52.609688Z"}], "thread_id": "Thread-29", "execution_time": 1.9294121265411377, "adapter_response": {"_message": "INSERT 16", "code": "INSERT", "rows_affected": 16}, "message": "INSERT 16", "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:50.758546Z", "completed_at": "2023-09-05T20:45:50.758546Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:50.763784Z", "completed_at": "2023-09-05T20:45:52.697685Z"}], "thread_id": "Thread-31", "execution_time": 2.1215200424194336, "adapter_response": {"_message": "INSERT 1676", "code": "INSERT", "rows_affected": 1676}, "message": "INSERT 1676", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:50.718219Z", "completed_at": "2023-09-05T20:45:50.718219Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:50.718219Z", "completed_at": "2023-09-05T20:45:52.843228Z"}], "thread_id": "Thread-33", "execution_time": 2.5403196811676025, "adapter_response": {"_message": "INSERT 276", "code": "INSERT", "rows_affected": 276}, "message": "INSERT 276", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:50.668539Z", "completed_at": "2023-09-05T20:45:50.668539Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:50.669572Z", "completed_at": "2023-09-05T20:45:52.838615Z"}], "thread_id": "Thread-34", "execution_time": 2.5900914669036865, "adapter_response": {"_message": "INSERT 2521", "code": "INSERT", "rows_affected": 2521}, "message": "INSERT 2521", "failures": null, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:50.779676Z", "completed_at": "2023-09-05T20:45:50.779676Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:50.779676Z", "completed_at": "2023-09-05T20:45:54.188365Z"}], "thread_id": "Thread-28", "execution_time": 3.784658432006836, "adapter_response": {"_message": "INSERT 18", "code": "INSERT", "rows_affected": 18}, "message": "INSERT 18", "failures": null, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:52.472127Z", "completed_at": "2023-09-05T20:45:52.472127Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:52.472127Z", "completed_at": "2023-09-05T20:45:55.301533Z"}], "thread_id": "Thread-30", "execution_time": 2.9279210567474365, "adapter_response": {"_message": "INSERT 55", "code": "INSERT", "rows_affected": 55}, "message": "INSERT 55", "failures": null, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:52.428271Z", "completed_at": "2023-09-05T20:45:52.428271Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:52.428271Z", "completed_at": "2023-09-05T20:45:55.360045Z"}], "thread_id": "Thread-32", "execution_time": 3.0300590991973877, "adapter_response": {"_message": "INSERT 9", "code": "INSERT", "rows_affected": 9}, "message": "INSERT 9", "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:52.722197Z", "completed_at": "2023-09-05T20:45:52.722197Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:52.722197Z", "completed_at": "2023-09-05T20:45:55.478265Z"}], "thread_id": "Thread-29", "execution_time": 2.8600544929504395, "adapter_response": {"_message": "INSERT 1272", "code": "INSERT", "rows_affected": 1272}, "message": "INSERT 1272", "failures": null, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:52.888711Z", "completed_at": "2023-09-05T20:45:52.888711Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:52.888711Z", "completed_at": "2023-09-05T20:45:55.554147Z"}], "thread_id": "Thread-31", "execution_time": 2.8315765857696533, "adapter_response": {"_message": "INSERT 1701", "code": "INSERT", "rows_affected": 1701}, "message": "INSERT 1701", "failures": null, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:53.279507Z", "completed_at": "2023-09-05T20:45:53.279507Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:53.287519Z", "completed_at": "2023-09-05T20:45:55.718184Z"}], "thread_id": "Thread-34", "execution_time": 2.5334620475769043, "adapter_response": {"_message": "INSERT 4", "code": "INSERT", "rows_affected": 4}, "message": "INSERT 4", "failures": null, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:54.546636Z", "completed_at": "2023-09-05T20:45:54.546636Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:54.547633Z", "completed_at": "2023-09-05T20:45:56.120662Z"}], "thread_id": "Thread-28", "execution_time": 1.6669166088104248, "adapter_response": {"_message": "INSERT 6", "code": "INSERT", "rows_affected": 6}, "message": "INSERT 6", "failures": null, "unique_id": "seed.the_tuva_project.terminology__code_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:53.277479Z", "completed_at": "2023-09-05T20:45:53.277479Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:53.278499Z", "completed_at": "2023-09-05T20:45:56.127551Z"}], "thread_id": "Thread-33", "execution_time": 2.9967153072357178, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.terminology__calendar"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:55.407633Z", "completed_at": "2023-09-05T20:45:55.407633Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:55.408685Z", "completed_at": "2023-09-05T20:45:57.885160Z"}], "thread_id": "Thread-30", "execution_time": 2.666139602661133, "adapter_response": {"_message": "INSERT 41", "code": "INSERT", "rows_affected": 41}, "message": "INSERT 41", "failures": null, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:55.458330Z", "completed_at": "2023-09-05T20:45:55.458330Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:55.458330Z", "completed_at": "2023-09-05T20:45:57.888711Z"}], "thread_id": "Thread-32", "execution_time": 2.614001512527466, "adapter_response": {"_message": "INSERT 18", "code": "INSERT", "rows_affected": 18}, "message": "INSERT 18", "failures": null, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:55.583038Z", "completed_at": "2023-09-05T20:45:55.583038Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:55.583038Z", "completed_at": "2023-09-05T20:45:57.888711Z"}], "thread_id": "Thread-29", "execution_time": 2.5099101066589355, "adapter_response": {"_message": "INSERT 4", "code": "INSERT", "rows_affected": 4}, "message": "INSERT 4", "failures": null, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:55.818446Z", "completed_at": "2023-09-05T20:45:55.818446Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:55.818446Z", "completed_at": "2023-09-05T20:45:59.148320Z"}], "thread_id": "Thread-34", "execution_time": 3.5312488079071045, "adapter_response": {"_message": "INSERT 3", "code": "INSERT", "rows_affected": 3}, "message": "INSERT 3", "failures": null, "unique_id": "seed.the_tuva_project.terminology__gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:55.722556Z", "completed_at": "2023-09-05T20:45:55.722556Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:55.722556Z", "completed_at": "2023-09-05T20:45:59.123415Z"}], "thread_id": "Thread-31", "execution_time": 3.6403496265411377, "adapter_response": {"_message": "INSERT 3232", "code": "INSERT", "rows_affected": 3232}, "message": "INSERT 3232", "failures": null, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:56.278632Z", "completed_at": "2023-09-05T20:45:56.278632Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:56.278632Z", "completed_at": "2023-09-05T20:45:59.268711Z"}], "thread_id": "Thread-33", "execution_time": 3.2220072746276855, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:58.288590Z", "completed_at": "2023-09-05T20:45:58.288590Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:58.288590Z", "completed_at": "2023-09-05T20:46:01.380055Z"}], "thread_id": "Thread-30", "execution_time": 3.187394618988037, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:56.219378Z", "completed_at": "2023-09-05T20:45:56.219378Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:56.219378Z", "completed_at": "2023-09-05T20:46:01.578261Z"}], "thread_id": "Thread-28", "execution_time": 5.480793476104736, "adapter_response": {"_message": "INSERT 7501", "code": "INSERT", "rows_affected": 7501}, "message": "INSERT 7501", "failures": null, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:41.438997Z", "completed_at": "2023-09-05T20:45:41.438997Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:41.438997Z", "completed_at": "2023-09-05T20:46:01.660941Z"}], "thread_id": "Thread-27", "execution_time": 20.327047109603882, "adapter_response": {"_message": "INSERT 55368", "code": "INSERT", "rows_affected": 55368}, "message": "INSERT 55368", "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:58.288590Z", "completed_at": "2023-09-05T20:45:58.288590Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:58.305547Z", "completed_at": "2023-09-05T20:46:01.669607Z"}], "thread_id": "Thread-29", "execution_time": 3.478957176208496, "adapter_response": {"_message": "INSERT 3882", "code": "INSERT", "rows_affected": 3882}, "message": "INSERT 3882", "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:59.440801Z", "completed_at": "2023-09-05T20:45:59.440801Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:59.440801Z", "completed_at": "2023-09-05T20:46:01.759348Z"}], "thread_id": "Thread-31", "execution_time": 2.4385805130004883, "adapter_response": {"_message": "INSERT 11", "code": "INSERT", "rows_affected": 11}, "message": "INSERT 11", "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:59.507712Z", "completed_at": "2023-09-05T20:45:59.507712Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:59.508218Z", "completed_at": "2023-09-05T20:46:01.799585Z"}], "thread_id": "Thread-33", "execution_time": 2.3928639888763428, "adapter_response": {"_message": "INSERT 5", "code": "INSERT", "rows_affected": 5}, "message": "INSERT 5", "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:59.440801Z", "completed_at": "2023-09-05T20:45:59.440801Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:59.440801Z", "completed_at": "2023-09-05T20:46:01.990075Z"}], "thread_id": "Thread-34", "execution_time": 2.651524305343628, "adapter_response": {"_message": "INSERT 25", "code": "INSERT", "rows_affected": 25}, "message": "INSERT 25", "failures": null, "unique_id": "seed.the_tuva_project.terminology__mdc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:01.479644Z", "completed_at": "2023-09-05T20:46:01.479644Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:01.479644Z", "completed_at": "2023-09-05T20:46:03.124494Z"}], "thread_id": "Thread-30", "execution_time": 1.8354005813598633, "adapter_response": {"_message": "INSERT 797", "code": "INSERT", "rows_affected": 797}, "message": "INSERT 797", "failures": null, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:01.881845Z", "completed_at": "2023-09-05T20:46:01.881845Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:01.881845Z", "completed_at": "2023-09-05T20:46:03.362286Z"}], "thread_id": "Thread-31", "execution_time": 1.5765814781188965, "adapter_response": {"_message": "INSERT 4", "code": "INSERT", "rows_affected": 4}, "message": "INSERT 4", "failures": null, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:01.772538Z", "completed_at": "2023-09-05T20:46:01.772538Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:01.778547Z", "completed_at": "2023-09-05T20:46:03.362286Z"}], "thread_id": "Thread-29", "execution_time": 1.6975767612457275, "adapter_response": {"_message": "INSERT 50", "code": "INSERT", "rows_affected": 50}, "message": "INSERT 50", "failures": null, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:01.772002Z", "completed_at": "2023-09-05T20:46:01.772002Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:01.772538Z", "completed_at": "2023-09-05T20:46:03.598464Z"}], "thread_id": "Thread-27", "execution_time": 1.9517943859100342, "adapter_response": {"_message": "INSERT 4", "code": "INSERT", "rows_affected": 4}, "message": "INSERT 4", "failures": null, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:02.090240Z", "completed_at": "2023-09-05T20:46:02.090240Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:02.090240Z", "completed_at": "2023-09-05T20:46:03.793860Z"}], "thread_id": "Thread-34", "execution_time": 1.7980830669403076, "adapter_response": {"_message": "INSERT 8", "code": "INSERT", "rows_affected": 8}, "message": "INSERT 8", "failures": null, "unique_id": "seed.the_tuva_project.terminology__race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:03.508625Z", "completed_at": "2023-09-05T20:46:03.517531Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:03.517531Z", "completed_at": "2023-09-05T20:46:04.040041Z"}], "thread_id": "Thread-29", "execution_time": 0.6509065628051758, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e1830185572a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:03.732080Z", "completed_at": "2023-09-05T20:46:03.740099Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:03.740099Z", "completed_at": "2023-09-05T20:46:04.218323Z"}], "thread_id": "Thread-27", "execution_time": 0.5762057304382324, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e18301855736"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:45:58.288590Z", "completed_at": "2023-09-05T20:45:58.288590Z"}, {"name": "execute", "started_at": "2023-09-05T20:45:58.299537Z", "completed_at": "2023-09-05T20:46:04.742691Z"}], "thread_id": "Thread-32", "execution_time": 6.545138835906982, "adapter_response": {"_message": "INSERT 14568", "code": "INSERT", "rows_affected": 14568}, "message": "INSERT 14568", "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:04.172268Z", "completed_at": "2023-09-05T20:46:04.178444Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:04.178444Z", "completed_at": "2023-09-05T20:46:04.905751Z"}], "thread_id": "Thread-29", "execution_time": 0.8294169902801514, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e18301856682"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:03.472218Z", "completed_at": "2023-09-05T20:46:03.472218Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:03.472218Z", "completed_at": "2023-09-05T20:46:05.089948Z"}], "thread_id": "Thread-31", "execution_time": 1.7267043590545654, "adapter_response": {"_message": "INSERT 78", "code": "INSERT", "rows_affected": 78}, "message": "INSERT 78", "failures": null, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:03.368294Z", "completed_at": "2023-09-05T20:46:03.368294Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:03.368294Z", "completed_at": "2023-09-05T20:46:05.189988Z"}], "thread_id": "Thread-30", "execution_time": 1.9112091064453125, "adapter_response": {"_message": "INSERT 526", "code": "INSERT", "rows_affected": 526}, "message": "INSERT 526", "failures": null, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:04.319487Z", "completed_at": "2023-09-05T20:46:04.322003Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:04.322003Z", "completed_at": "2023-09-05T20:46:05.207595Z"}], "thread_id": "Thread-27", "execution_time": 0.9808564186096191, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e18301855756"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:03.894202Z", "completed_at": "2023-09-05T20:46:03.905618Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:03.905618Z", "completed_at": "2023-09-05T20:46:05.218659Z"}], "thread_id": "Thread-34", "execution_time": 1.407707929611206, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e18301855742"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:04.999593Z", "completed_at": "2023-09-05T20:46:05.005683Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.007693Z", "completed_at": "2023-09-05T20:46:05.430208Z"}], "thread_id": "Thread-29", "execution_time": 0.5386998653411865, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be0f-0057-e183018566a2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.199511Z", "completed_at": "2023-09-05T20:46:05.208648Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.208648Z", "completed_at": "2023-09-05T20:46:05.684067Z"}], "thread_id": "Thread-31", "execution_time": 0.6031041145324707, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566aa"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.288563Z", "completed_at": "2023-09-05T20:46:05.288563Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.288563Z", "completed_at": "2023-09-05T20:46:05.791707Z"}], "thread_id": "Thread-30", "execution_time": 0.6002190113067627, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185576e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.311483Z", "completed_at": "2023-09-05T20:46:05.319590Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.319590Z", "completed_at": "2023-09-05T20:46:05.798235Z"}], "thread_id": "Thread-34", "execution_time": 0.5967390537261963, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855772"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.308464Z", "completed_at": "2023-09-05T20:46:05.311483Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.311483Z", "completed_at": "2023-09-05T20:46:05.833583Z"}], "thread_id": "Thread-27", "execution_time": 0.6211550235748291, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566ae"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.539776Z", "completed_at": "2023-09-05T20:46:05.549566Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.549566Z", "completed_at": "2023-09-05T20:46:06.044185Z"}], "thread_id": "Thread-29", "execution_time": 0.5906317234039307, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185577a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:04.838255Z", "completed_at": "2023-09-05T20:46:04.849960Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:04.849960Z", "completed_at": "2023-09-05T20:46:06.058475Z"}], "thread_id": "Thread-32", "execution_time": 1.3292536735534668, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafd-0603-be2c-0057-e1830185575e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.927500Z", "completed_at": "2023-09-05T20:46:05.929619Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.929619Z", "completed_at": "2023-09-05T20:46:06.608645Z"}], "thread_id": "Thread-34", "execution_time": 0.7862570285797119, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566c6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__claim_type_mapping_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.888782Z", "completed_at": "2023-09-05T20:46:05.900041Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.900041Z", "completed_at": "2023-09-05T20:46:06.810042Z"}], "thread_id": "Thread-30", "execution_time": 1.0164637565612793, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566c2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__medical_claim_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:05.816001Z", "completed_at": "2023-09-05T20:46:05.822038Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:05.822038Z", "completed_at": "2023-09-05T20:46:06.888786Z"}], "thread_id": "Thread-31", "execution_time": 1.1637802124023438, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566be"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__date_issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:06.172028Z", "completed_at": "2023-09-05T20:46:06.199563Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:06.208272Z", "completed_at": "2023-09-05T20:46:07.029269Z"}], "thread_id": "Thread-27", "execution_time": 0.967043399810791, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855786"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__claim_type_unmapped"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:06.179589Z", "completed_at": "2023-09-05T20:46:06.208272Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:06.208272Z", "completed_at": "2023-09-05T20:46:07.262899Z"}], "thread_id": "Thread-29", "execution_time": 1.1897454261779785, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185578a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:06.709542Z", "completed_at": "2023-09-05T20:46:06.715556Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:06.717558Z", "completed_at": "2023-09-05T20:46:07.441339Z"}], "thread_id": "Thread-34", "execution_time": 0.8387188911437988, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566d2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:06.978302Z", "completed_at": "2023-09-05T20:46:06.989530Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:06.992388Z", "completed_at": "2023-09-05T20:46:07.795993Z"}], "thread_id": "Thread-31", "execution_time": 0.9220044612884521, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185579a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:06.908474Z", "completed_at": "2023-09-05T20:46:06.913459Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:06.913459Z", "completed_at": "2023-09-05T20:46:07.803765Z"}], "thread_id": "Thread-30", "execution_time": 0.9980709552764893, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855796"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:06.179589Z", "completed_at": "2023-09-05T20:46:06.208272Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:06.217433Z", "completed_at": "2023-09-05T20:46:07.806273Z"}], "thread_id": "Thread-32", "execution_time": 1.7288129329681396, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185578e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:07.147583Z", "completed_at": "2023-09-05T20:46:07.150607Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:07.150607Z", "completed_at": "2023-09-05T20:46:08.078413Z"}], "thread_id": "Thread-27", "execution_time": 1.033109426498413, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557a2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:07.568209Z", "completed_at": "2023-09-05T20:46:07.569799Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:07.572303Z", "completed_at": "2023-09-05T20:46:08.058346Z"}], "thread_id": "Thread-34", "execution_time": 0.6068394184112549, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557ae"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:07.371980Z", "completed_at": "2023-09-05T20:46:07.378614Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:07.378614Z", "completed_at": "2023-09-05T20:46:08.327847Z"}], "thread_id": "Thread-29", "execution_time": 1.067596673965454, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566de"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__professional_header_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:08.210557Z", "completed_at": "2023-09-05T20:46:08.217534Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:08.220641Z", "completed_at": "2023-09-05T20:46:08.698670Z"}], "thread_id": "Thread-34", "execution_time": 0.5997045040130615, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856702"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:07.938187Z", "completed_at": "2023-09-05T20:46:08.058346Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:08.067588Z", "completed_at": "2023-09-05T20:46:09.022349Z"}], "thread_id": "Thread-32", "execution_time": 1.1797387599945068, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566f6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:08.217534Z", "completed_at": "2023-09-05T20:46:08.224236Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:08.225217Z", "completed_at": "2023-09-05T20:46:09.068478Z"}], "thread_id": "Thread-27", "execution_time": 0.9518365859985352, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566fe"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:07.908402Z", "completed_at": "2023-09-05T20:46:07.922277Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:07.930175Z", "completed_at": "2023-09-05T20:46:09.148412Z"}], "thread_id": "Thread-31", "execution_time": 1.3305003643035889, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018566f2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__claims_without_enrollment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:08.822710Z", "completed_at": "2023-09-05T20:46:08.822710Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:08.822710Z", "completed_at": "2023-09-05T20:46:09.258276Z"}], "thread_id": "Thread-34", "execution_time": 0.5659365653991699, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557ce"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:08.439950Z", "completed_at": "2023-09-05T20:46:08.451771Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:08.451771Z", "completed_at": "2023-09-05T20:46:09.459744Z"}], "thread_id": "Thread-29", "execution_time": 1.1250450611114502, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185670a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:07.923351Z", "completed_at": "2023-09-05T20:46:07.938187Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:07.947433Z", "completed_at": "2023-09-05T20:46:09.550410Z"}], "thread_id": "Thread-30", "execution_time": 1.7573189735412598, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557ba"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__duplicate_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.119801Z", "completed_at": "2023-09-05T20:46:09.125814Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.125814Z", "completed_at": "2023-09-05T20:46:09.739760Z"}], "thread_id": "Thread-32", "execution_time": 0.7285647392272949, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185671e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.388646Z", "completed_at": "2023-09-05T20:46:09.448464Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.448464Z", "completed_at": "2023-09-05T20:46:10.379867Z"}], "thread_id": "Thread-34", "execution_time": 1.1099627017974854, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185672a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.688901Z", "completed_at": "2023-09-05T20:46:09.693013Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.693013Z", "completed_at": "2023-09-05T20:46:10.598503Z"}], "thread_id": "Thread-30", "execution_time": 1.0000505447387695, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557da"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.569765Z", "completed_at": "2023-09-05T20:46:09.589850Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.589850Z", "completed_at": "2023-09-05T20:46:10.812951Z"}], "thread_id": "Thread-29", "execution_time": 1.340768814086914, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856732"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.173434Z", "completed_at": "2023-09-05T20:46:09.178464Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.179609Z", "completed_at": "2023-09-05T20:46:10.952883Z"}], "thread_id": "Thread-27", "execution_time": 1.8850038051605225, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856722"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.238902Z", "completed_at": "2023-09-05T20:46:09.257769Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.258276Z", "completed_at": "2023-09-05T20:46:11.165219Z"}], "thread_id": "Thread-31", "execution_time": 2.039296865463257, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856726"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:10.505646Z", "completed_at": "2023-09-05T20:46:10.509703Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:10.509703Z", "completed_at": "2023-09-05T20:46:11.340856Z"}], "thread_id": "Thread-34", "execution_time": 0.9230060577392578, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557f2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:09.858466Z", "completed_at": "2023-09-05T20:46:09.878564Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:09.878564Z", "completed_at": "2023-09-05T20:46:11.408230Z"}], "thread_id": "Thread-32", "execution_time": 1.658130168914795, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557de"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:10.693982Z", "completed_at": "2023-09-05T20:46:10.699692Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:10.699692Z", "completed_at": "2023-09-05T20:46:11.477565Z"}], "thread_id": "Thread-30", "execution_time": 0.9013245105743408, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557f6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:10.921105Z", "completed_at": "2023-09-05T20:46:10.922108Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:10.922108Z", "completed_at": "2023-09-05T20:46:11.704439Z"}], "thread_id": "Thread-29", "execution_time": 0.8821825981140137, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185674a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:11.063610Z", "completed_at": "2023-09-05T20:46:11.066617Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:11.066617Z", "completed_at": "2023-09-05T20:46:12.008468Z"}], "thread_id": "Thread-27", "execution_time": 1.0459270477294922, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018557fe"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:11.439621Z", "completed_at": "2023-09-05T20:46:11.458392Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:11.458392Z", "completed_at": "2023-09-05T20:46:12.319899Z"}], "thread_id": "Thread-34", "execution_time": 0.9841787815093994, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855806"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:11.518681Z", "completed_at": "2023-09-05T20:46:11.529659Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:11.531722Z", "completed_at": "2023-09-05T20:46:12.328675Z"}], "thread_id": "Thread-32", "execution_time": 0.9198434352874756, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185675e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:11.805271Z", "completed_at": "2023-09-05T20:46:11.811564Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:11.811564Z", "completed_at": "2023-09-05T20:46:12.558358Z"}], "thread_id": "Thread-29", "execution_time": 0.874854326248169, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856766"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:11.786637Z", "completed_at": "2023-09-05T20:46:11.794064Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:11.795015Z", "completed_at": "2023-09-05T20:46:12.621824Z"}], "thread_id": "Thread-30", "execution_time": 0.9726662635803223, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185580e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:11.288675Z", "completed_at": "2023-09-05T20:46:11.300184Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:11.300184Z", "completed_at": "2023-09-05T20:46:12.628560Z"}], "thread_id": "Thread-31", "execution_time": 1.4696321487426758, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855802"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.110349Z", "completed_at": "2023-09-05T20:46:12.118538Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.118538Z", "completed_at": "2023-09-05T20:46:12.860591Z"}], "thread_id": "Thread-27", "execution_time": 0.862088680267334, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185581a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.429893Z", "completed_at": "2023-09-05T20:46:12.438524Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.438524Z", "completed_at": "2023-09-05T20:46:13.289866Z"}], "thread_id": "Thread-34", "execution_time": 0.9685618877410889, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856776"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.686968Z", "completed_at": "2023-09-05T20:46:12.688643Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.688643Z", "completed_at": "2023-09-05T20:46:13.368595Z"}], "thread_id": "Thread-29", "execution_time": 0.7845630645751953, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185677e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.772040Z", "completed_at": "2023-09-05T20:46:12.781081Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.781081Z", "completed_at": "2023-09-05T20:46:13.587398Z"}], "thread_id": "Thread-30", "execution_time": 0.929729700088501, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856786"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.448247Z", "completed_at": "2023-09-05T20:46:12.478339Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.478339Z", "completed_at": "2023-09-05T20:46:13.621991Z"}], "thread_id": "Thread-32", "execution_time": 1.2721703052520752, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856772"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.778563Z", "completed_at": "2023-09-05T20:46:12.781081Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.787587Z", "completed_at": "2023-09-05T20:46:13.639676Z"}], "thread_id": "Thread-31", "execution_time": 1.0178470611572266, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185581e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:12.980014Z", "completed_at": "2023-09-05T20:46:12.989053Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:12.989053Z", "completed_at": "2023-09-05T20:46:13.899865Z"}], "thread_id": "Thread-27", "execution_time": 1.0196709632873535, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855826"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:01.699694Z", "completed_at": "2023-09-05T20:46:01.699694Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:01.699694Z", "completed_at": "2023-09-05T20:46:13.987466Z"}], "thread_id": "Thread-28", "execution_time": 12.390039682388306, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:13.401479Z", "completed_at": "2023-09-05T20:46:13.409784Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:13.409784Z", "completed_at": "2023-09-05T20:46:14.279756Z"}], "thread_id": "Thread-34", "execution_time": 0.9826066493988037, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185582e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:13.472277Z", "completed_at": "2023-09-05T20:46:13.478299Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:13.481809Z", "completed_at": "2023-09-05T20:46:14.308517Z"}], "thread_id": "Thread-29", "execution_time": 0.9278404712677002, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855832"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:13.702647Z", "completed_at": "2023-09-05T20:46:13.709816Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:13.709816Z", "completed_at": "2023-09-05T20:46:14.461402Z"}], "thread_id": "Thread-30", "execution_time": 0.8657269477844238, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185583a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:13.789887Z", "completed_at": "2023-09-05T20:46:13.798500Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:13.798500Z", "completed_at": "2023-09-05T20:46:14.509854Z"}], "thread_id": "Thread-31", "execution_time": 0.830984354019165, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185679e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:13.728232Z", "completed_at": "2023-09-05T20:46:13.733964Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:13.733964Z", "completed_at": "2023-09-05T20:46:14.509854Z"}], "thread_id": "Thread-32", "execution_time": 0.8946847915649414, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185583e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.093260Z", "completed_at": "2023-09-05T20:46:14.102780Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.102780Z", "completed_at": "2023-09-05T20:46:14.805763Z"}], "thread_id": "Thread-28", "execution_time": 0.8065669536590576, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855852"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:13.999685Z", "completed_at": "2023-09-05T20:46:14.008392Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.008392Z", "completed_at": "2023-09-05T20:46:14.839486Z"}], "thread_id": "Thread-27", "execution_time": 0.940706729888916, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185584e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.389398Z", "completed_at": "2023-09-05T20:46:14.397504Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.397504Z", "completed_at": "2023-09-05T20:46:15.152896Z"}], "thread_id": "Thread-34", "execution_time": 0.8602490425109863, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567aa"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.407640Z", "completed_at": "2023-09-05T20:46:14.412327Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.413250Z", "completed_at": "2023-09-05T20:46:15.155476Z"}], "thread_id": "Thread-29", "execution_time": 0.8484079837799072, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567ae"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.573490Z", "completed_at": "2023-09-05T20:46:14.579746Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.579746Z", "completed_at": "2023-09-05T20:46:15.288910Z"}], "thread_id": "Thread-30", "execution_time": 0.8151130676269531, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567b2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.628433Z", "completed_at": "2023-09-05T20:46:14.639278Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.639278Z", "completed_at": "2023-09-05T20:46:15.349985Z"}], "thread_id": "Thread-31", "execution_time": 0.8259999752044678, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567b6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.628433Z", "completed_at": "2023-09-05T20:46:14.639278Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.648462Z", "completed_at": "2023-09-05T20:46:15.390935Z"}], "thread_id": "Thread-32", "execution_time": 0.8714697360992432, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567ba"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.908039Z", "completed_at": "2023-09-05T20:46:14.913160Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.913160Z", "completed_at": "2023-09-05T20:46:15.663266Z"}], "thread_id": "Thread-28", "execution_time": 0.8511674404144287, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855866"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:14.945934Z", "completed_at": "2023-09-05T20:46:14.948589Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:14.948589Z", "completed_at": "2023-09-05T20:46:15.676012Z"}], "thread_id": "Thread-27", "execution_time": 0.8335056304931641, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185586e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__patient"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.499392Z", "completed_at": "2023-09-05T20:46:15.508604Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.508604Z", "completed_at": "2023-09-05T20:46:16.150125Z"}], "thread_id": "Thread-32", "execution_time": 0.749197244644165, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.758611Z", "completed_at": "2023-09-05T20:46:15.772157Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.772157Z", "completed_at": "2023-09-05T20:46:16.175095Z"}], "thread_id": "Thread-28", "execution_time": 0.5134172439575195, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.272086Z", "completed_at": "2023-09-05T20:46:15.279786Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.288910Z", "completed_at": "2023-09-05T20:46:16.022048Z"}], "thread_id": "Thread-29", "execution_time": 0.8479249477386475, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185587e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.259376Z", "completed_at": "2023-09-05T20:46:15.267474Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.268481Z", "completed_at": "2023-09-05T20:46:16.150125Z"}], "thread_id": "Thread-34", "execution_time": 0.9902913570404053, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567c2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.398587Z", "completed_at": "2023-09-05T20:46:15.398587Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.405624Z", "completed_at": "2023-09-05T20:46:16.178271Z"}], "thread_id": "Thread-30", "execution_time": 0.8734419345855713, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567c6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.457761Z", "completed_at": "2023-09-05T20:46:15.459574Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.459574Z", "completed_at": "2023-09-05T20:46:16.722800Z"}], "thread_id": "Thread-31", "execution_time": 1.3644185066223145, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855886"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__date_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:15.788963Z", "completed_at": "2023-09-05T20:46:15.797470Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:15.797470Z", "completed_at": "2023-09-05T20:46:16.969717Z"}], "thread_id": "Thread-27", "execution_time": 1.2709689140319824, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855892"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:16.278560Z", "completed_at": "2023-09-05T20:46:16.288573Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:16.289326Z", "completed_at": "2023-09-05T20:46:16.958501Z"}], "thread_id": "Thread-28", "execution_time": 0.7869195938110352, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567de"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:16.304059Z", "completed_at": "2023-09-05T20:46:16.309604Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:16.322341Z", "completed_at": "2023-09-05T20:46:17.139555Z"}], "thread_id": "Thread-29", "execution_time": 0.9368512630462646, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567e2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:16.309604Z", "completed_at": "2023-09-05T20:46:16.325424Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:16.329563Z", "completed_at": "2023-09-05T20:46:17.139555Z"}], "thread_id": "Thread-30", "execution_time": 0.9389433860778809, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018567e6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:16.309604Z", "completed_at": "2023-09-05T20:46:16.322341Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:16.327433Z", "completed_at": "2023-09-05T20:46:17.229627Z"}], "thread_id": "Thread-34", "execution_time": 1.027951717376709, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185589e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:16.258411Z", "completed_at": "2023-09-05T20:46:16.268325Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:16.268325Z", "completed_at": "2023-09-05T20:46:17.222187Z"}], "thread_id": "Thread-32", "execution_time": 1.0782201290130615, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855896"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.068529Z", "completed_at": "2023-09-05T20:46:17.087613Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.087613Z", "completed_at": "2023-09-05T20:46:17.558701Z"}], "thread_id": "Thread-27", "execution_time": 0.5991621017456055, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558ba"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.258265Z", "completed_at": "2023-09-05T20:46:17.258265Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.258265Z", "completed_at": "2023-09-05T20:46:17.780261Z"}], "thread_id": "Thread-30", "execution_time": 0.6338958740234375, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.accepted_values_quality_measures_reporting__stg_core__patient_gender__female__male.f79cbe4ef9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:16.949727Z", "completed_at": "2023-09-05T20:46:16.963503Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:16.963503Z", "completed_at": "2023-09-05T20:46:17.887554Z"}], "thread_id": "Thread-31", "execution_time": 1.0406599044799805, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558b2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.669287Z", "completed_at": "2023-09-05T20:46:17.678503Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.678503Z", "completed_at": "2023-09-05T20:46:18.340378Z"}], "thread_id": "Thread-27", "execution_time": 0.7803630828857422, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_patient_id.041deb4a3f"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.349641Z", "completed_at": "2023-09-05T20:46:17.352744Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.355326Z", "completed_at": "2023-09-05T20:46:18.348586Z"}], "thread_id": "Thread-32", "execution_time": 1.1300907135009766, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_gender.d0ab41c19d"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.338654Z", "completed_at": "2023-09-05T20:46:17.352744Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.352744Z", "completed_at": "2023-09-05T20:46:18.517758Z"}], "thread_id": "Thread-34", "execution_time": 1.265547752380371, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__patient_birth_date.663daf5e0e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.079439Z", "completed_at": "2023-09-05T20:46:17.099700Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.099700Z", "completed_at": "2023-09-05T20:46:18.618325Z"}], "thread_id": "Thread-28", "execution_time": 1.6490042209625244, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558be"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.249680Z", "completed_at": "2023-09-05T20:46:17.258265Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.258265Z", "completed_at": "2023-09-05T20:46:18.779574Z"}], "thread_id": "Thread-29", "execution_time": 1.6223413944244385, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558c6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.889582Z", "completed_at": "2023-09-05T20:46:17.898283Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:17.898283Z", "completed_at": "2023-09-05T20:46:18.949753Z"}], "thread_id": "Thread-30", "execution_time": 1.2327487468719482, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856806"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:18.449650Z", "completed_at": "2023-09-05T20:46:18.460039Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:18.460039Z", "completed_at": "2023-09-05T20:46:18.930165Z"}], "thread_id": "Thread-27", "execution_time": 0.6782093048095703, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856816"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:18.468745Z", "completed_at": "2023-09-05T20:46:18.479863Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:18.479863Z", "completed_at": "2023-09-05T20:46:18.949753Z"}], "thread_id": "Thread-32", "execution_time": 0.6597001552581787, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558e2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:18.878678Z", "completed_at": "2023-09-05T20:46:18.881782Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:18.881782Z", "completed_at": "2023-09-05T20:46:19.325518Z"}], "thread_id": "Thread-29", "execution_time": 0.5698950290679932, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:18.607492Z", "completed_at": "2023-09-05T20:46:18.609900Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:18.609900Z", "completed_at": "2023-09-05T20:46:19.178441Z"}], "thread_id": "Thread-34", "execution_time": 0.841080904006958, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558e6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_time_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:17.990387Z", "completed_at": "2023-09-05T20:46:18.002726Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:18.002726Z", "completed_at": "2023-09-05T20:46:19.652608Z"}], "thread_id": "Thread-31", "execution_time": 1.7980992794036865, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558d6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:19.155421Z", "completed_at": "2023-09-05T20:46:19.158462Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:19.168274Z", "completed_at": "2023-09-05T20:46:19.788487Z"}], "thread_id": "Thread-32", "execution_time": 0.7404353618621826, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185683e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:19.149409Z", "completed_at": "2023-09-05T20:46:19.158462Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:19.158462Z", "completed_at": "2023-09-05T20:46:19.829535Z"}], "thread_id": "Thread-27", "execution_time": 0.7863583564758301, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856836"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:19.142331Z", "completed_at": "2023-09-05T20:46:19.158462Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:19.158462Z", "completed_at": "2023-09-05T20:46:19.968554Z"}], "thread_id": "Thread-30", "execution_time": 0.94954514503479, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558ee"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:18.738850Z", "completed_at": "2023-09-05T20:46:18.769862Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:18.769862Z", "completed_at": "2023-09-05T20:46:20.022314Z"}], "thread_id": "Thread-28", "execution_time": 1.4066994190216064, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558ea"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:19.458688Z", "completed_at": "2023-09-05T20:46:19.468306Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:19.468306Z", "completed_at": "2023-09-05T20:46:20.278496Z"}], "thread_id": "Thread-29", "execution_time": 0.9301190376281738, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018558f6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:19.798603Z", "completed_at": "2023-09-05T20:46:19.827463Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:19.829535Z", "completed_at": "2023-09-05T20:46:20.537800Z"}], "thread_id": "Thread-34", "execution_time": 0.8428454399108887, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856846"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:19.798603Z", "completed_at": "2023-09-05T20:46:19.829535Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:19.829535Z", "completed_at": "2023-09-05T20:46:20.640406Z"}], "thread_id": "Thread-31", "execution_time": 0.942467451095581, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855906"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.169196Z", "completed_at": "2023-09-05T20:46:20.178246Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.178246Z", "completed_at": "2023-09-05T20:46:20.878631Z"}], "thread_id": "Thread-28", "execution_time": 0.8142037391662598, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185685a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.138614Z", "completed_at": "2023-09-05T20:46:20.147019Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.157548Z", "completed_at": "2023-09-05T20:46:21.022221Z"}], "thread_id": "Thread-30", "execution_time": 1.0058495998382568, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185590a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.133034Z", "completed_at": "2023-09-05T20:46:20.145721Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.149836Z", "completed_at": "2023-09-05T20:46:21.007621Z"}], "thread_id": "Thread-27", "execution_time": 1.0058495998382568, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185590e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.401869Z", "completed_at": "2023-09-05T20:46:20.418371Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.418371Z", "completed_at": "2023-09-05T20:46:21.218291Z"}], "thread_id": "Thread-29", "execution_time": 0.9065501689910889, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185686a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__use_case"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.648529Z", "completed_at": "2023-09-05T20:46:20.661895Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.661895Z", "completed_at": "2023-09-05T20:46:21.315698Z"}], "thread_id": "Thread-34", "execution_time": 0.7615456581115723, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856872"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.109847Z", "completed_at": "2023-09-05T20:46:20.143947Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.147523Z", "completed_at": "2023-09-05T20:46:21.359852Z"}], "thread_id": "Thread-32", "execution_time": 1.3485543727874756, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856856"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:20.758497Z", "completed_at": "2023-09-05T20:46:20.821906Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:20.821906Z", "completed_at": "2023-09-05T20:46:21.640021Z"}], "thread_id": "Thread-31", "execution_time": 0.9801006317138672, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855916"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:21.122335Z", "completed_at": "2023-09-05T20:46:21.129863Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:21.129863Z", "completed_at": "2023-09-05T20:46:21.859591Z"}], "thread_id": "Thread-28", "execution_time": 0.8552422523498535, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185687a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:21.762860Z", "completed_at": "2023-09-05T20:46:21.769441Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:21.771999Z", "completed_at": "2023-09-05T20:46:22.308407Z"}], "thread_id": "Thread-30", "execution_time": 0.6883649826049805, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855932"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:21.749935Z", "completed_at": "2023-09-05T20:46:21.762860Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:21.768398Z", "completed_at": "2023-09-05T20:46:22.750101Z"}], "thread_id": "Thread-27", "execution_time": 1.112168788909912, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856886"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:22.448513Z", "completed_at": "2023-09-05T20:46:22.449851Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:22.449851Z", "completed_at": "2023-09-05T20:46:23.308521Z"}], "thread_id": "Thread-34", "execution_time": 1.5367786884307861, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185593e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:01.913181Z", "completed_at": "2023-09-05T20:46:01.913181Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:01.913181Z", "completed_at": "2023-09-05T20:46:24.078664Z"}], "thread_id": "Thread-33", "execution_time": 22.26534152030945, "adapter_response": {"_message": "INSERT 0", "code": "INSERT", "rows_affected": 0}, "message": "INSERT 0", "failures": null, "unique_id": "seed.the_tuva_project.terminology__provider"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:23.989324Z", "completed_at": "2023-09-05T20:46:24.008259Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:24.008259Z", "completed_at": "2023-09-05T20:46:24.805403Z"}], "thread_id": "Thread-31", "execution_time": 1.1905364990234375, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185594e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:25.179861Z", "completed_at": "2023-09-05T20:46:25.188511Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:25.188511Z", "completed_at": "2023-09-05T20:46:25.741841Z"}], "thread_id": "Thread-28", "execution_time": 0.6818451881408691, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568a6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:25.908174Z", "completed_at": "2023-09-05T20:46:25.909755Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:25.918290Z", "completed_at": "2023-09-05T20:46:26.577901Z"}], "thread_id": "Thread-34", "execution_time": 0.801311731338501, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185596e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:25.872252Z", "completed_at": "2023-09-05T20:46:25.909755Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:25.909755Z", "completed_at": "2023-09-05T20:46:26.822179Z"}], "thread_id": "Thread-32", "execution_time": 1.0380911827087402, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568b6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:25.878292Z", "completed_at": "2023-09-05T20:46:25.909755Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:25.918290Z", "completed_at": "2023-09-05T20:46:27.230188Z"}], "thread_id": "Thread-27", "execution_time": 1.4563612937927246, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568b2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:26.922026Z", "completed_at": "2023-09-05T20:46:26.933710Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:26.933710Z", "completed_at": "2023-09-05T20:46:27.405578Z"}], "thread_id": "Thread-29", "execution_time": 0.5879378318786621, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185599e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:26.690763Z", "completed_at": "2023-09-05T20:46:26.704565Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:26.706579Z", "completed_at": "2023-09-05T20:46:27.572332Z"}], "thread_id": "Thread-31", "execution_time": 0.9903450012207031, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e1830185598e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:26.700551Z", "completed_at": "2023-09-05T20:46:26.705463Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:26.709521Z", "completed_at": "2023-09-05T20:46:27.572332Z"}], "thread_id": "Thread-30", "execution_time": 1.000002384185791, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855992"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:26.684396Z", "completed_at": "2023-09-05T20:46:26.689741Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:26.697684Z", "completed_at": "2023-09-05T20:46:27.588667Z"}], "thread_id": "Thread-33", "execution_time": 1.0100646018981934, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568be"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:27.332724Z", "completed_at": "2023-09-05T20:46:27.339968Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:27.339968Z", "completed_at": "2023-09-05T20:46:27.798170Z"}], "thread_id": "Thread-28", "execution_time": 0.5668070316314697, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568ca"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:27.741081Z", "completed_at": "2023-09-05T20:46:27.760670Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:27.760670Z", "completed_at": "2023-09-05T20:46:28.587773Z"}], "thread_id": "Thread-33", "execution_time": 0.9603712558746338, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559b6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:27.522002Z", "completed_at": "2023-09-05T20:46:27.540069Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:27.540069Z", "completed_at": "2023-09-05T20:46:28.838555Z"}], "thread_id": "Thread-34", "execution_time": 1.490126132965088, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568ce"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:27.529700Z", "completed_at": "2023-09-05T20:46:27.540069Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:27.549765Z", "completed_at": "2023-09-05T20:46:28.838555Z"}], "thread_id": "Thread-27", "execution_time": 1.4977784156799316, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568d2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:27.700150Z", "completed_at": "2023-09-05T20:46:27.728506Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:27.728506Z", "completed_at": "2023-09-05T20:46:29.172123Z"}], "thread_id": "Thread-29", "execution_time": 1.5675513744354248, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559ba"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:27.719758Z", "completed_at": "2023-09-05T20:46:27.728506Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:27.728506Z", "completed_at": "2023-09-05T20:46:29.391197Z"}], "thread_id": "Thread-31", "execution_time": 1.8062758445739746, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568da"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:28.719677Z", "completed_at": "2023-09-05T20:46:28.748598Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:28.751314Z", "completed_at": "2023-09-05T20:46:29.458401Z"}], "thread_id": "Thread-30", "execution_time": 0.8421802520751953, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568e6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:28.729486Z", "completed_at": "2023-09-05T20:46:28.749732Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:28.755323Z", "completed_at": "2023-09-05T20:46:29.468288Z"}], "thread_id": "Thread-28", "execution_time": 0.857511043548584, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568e2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:28.717861Z", "completed_at": "2023-09-05T20:46:28.747588Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:28.749732Z", "completed_at": "2023-09-05T20:46:29.498686Z"}], "thread_id": "Thread-32", "execution_time": 0.8910689353942871, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559ce"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:28.738594Z", "completed_at": "2023-09-05T20:46:28.749732Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:28.758417Z", "completed_at": "2023-09-05T20:46:29.560491Z"}], "thread_id": "Thread-33", "execution_time": 0.9515640735626221, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559ca"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:29.024299Z", "completed_at": "2023-09-05T20:46:29.030088Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:29.030088Z", "completed_at": "2023-09-05T20:46:30.031698Z"}], "thread_id": "Thread-34", "execution_time": 1.1386630535125732, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568ea"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:29.039873Z", "completed_at": "2023-09-05T20:46:29.039873Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:29.047458Z", "completed_at": "2023-09-05T20:46:30.038322Z"}], "thread_id": "Thread-27", "execution_time": 1.1198010444641113, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018568ee"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.core__procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:29.668272Z", "completed_at": "2023-09-05T20:46:29.697618Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:29.698670Z", "completed_at": "2023-09-05T20:46:30.610022Z"}], "thread_id": "Thread-29", "execution_time": 1.0457038879394531, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559da"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.389776Z", "completed_at": "2023-09-05T20:46:30.409671Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.429692Z", "completed_at": "2023-09-05T20:46:30.938655Z"}], "thread_id": "Thread-27", "execution_time": 0.7257599830627441, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__condition_patient_id.ba929c7001"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.398306Z", "completed_at": "2023-09-05T20:46:30.409671Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.422302Z", "completed_at": "2023-09-05T20:46:30.939937Z"}], "thread_id": "Thread-30", "execution_time": 0.7111170291900635, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185690e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.432702Z", "completed_at": "2023-09-05T20:46:30.455370Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.458389Z", "completed_at": "2023-09-05T20:46:31.208351Z"}], "thread_id": "Thread-28", "execution_time": 0.9309501647949219, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856912"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.447723Z", "completed_at": "2023-09-05T20:46:30.458389Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.465723Z", "completed_at": "2023-09-05T20:46:31.355715Z"}], "thread_id": "Thread-32", "execution_time": 1.0343225002288818, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559f2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.338993Z", "completed_at": "2023-09-05T20:46:30.397799Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.409671Z", "completed_at": "2023-09-05T20:46:31.358361Z"}], "thread_id": "Thread-31", "execution_time": 1.1363153457641602, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559ea"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.365753Z", "completed_at": "2023-09-05T20:46:30.398306Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.409671Z", "completed_at": "2023-09-05T20:46:31.358361Z"}], "thread_id": "Thread-34", "execution_time": 1.1272556781768799, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559fe"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.332464Z", "completed_at": "2023-09-05T20:46:30.389776Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.405417Z", "completed_at": "2023-09-05T20:46:31.439064Z"}], "thread_id": "Thread-33", "execution_time": 1.2498610019683838, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e183018559ee"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.062266Z", "completed_at": "2023-09-05T20:46:31.069768Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.069768Z", "completed_at": "2023-09-05T20:46:31.439064Z"}], "thread_id": "Thread-27", "execution_time": 0.5175068378448486, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_quality_measures_reporting__stg_core__procedure_patient_id.c39ccf18d3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:30.718444Z", "completed_at": "2023-09-05T20:46:30.749333Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:30.749333Z", "completed_at": "2023-09-05T20:46:31.659509Z"}], "thread_id": "Thread-29", "execution_time": 1.0400230884552002, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185691a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.233480Z", "completed_at": "2023-09-05T20:46:31.239770Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.239770Z", "completed_at": "2023-09-05T20:46:31.698685Z"}], "thread_id": "Thread-30", "execution_time": 0.621706485748291, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185692a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.348211Z", "completed_at": "2023-09-05T20:46:31.349208Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.349208Z", "completed_at": "2023-09-05T20:46:31.779330Z"}], "thread_id": "Thread-28", "execution_time": 0.5315184593200684, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.487527Z", "completed_at": "2023-09-05T20:46:31.488606Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.505786Z", "completed_at": "2023-09-05T20:46:31.901935Z"}], "thread_id": "Thread-31", "execution_time": 0.5173687934875488, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.459720Z", "completed_at": "2023-09-05T20:46:31.468280Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.469087Z", "completed_at": "2023-09-05T20:46:31.977504Z"}], "thread_id": "Thread-32", "execution_time": 0.6126763820648193, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856932"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__primary_diagnosis_count"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.579773Z", "completed_at": "2023-09-05T20:46:31.579773Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.587780Z", "completed_at": "2023-09-05T20:46:32.009294Z"}], "thread_id": "Thread-33", "execution_time": 0.5288400650024414, "adapter_response": {}, "message": null, "failures": 0, "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": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.588877Z", "completed_at": "2023-09-05T20:46:31.598467Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.599616Z", "completed_at": "2023-09-05T20:46:32.017568Z"}], "thread_id": "Thread-27", "execution_time": 0.5355322360992432, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.857788Z", "completed_at": "2023-09-05T20:46:31.862127Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.862127Z", "completed_at": "2023-09-05T20:46:32.179177Z"}], "thread_id": "Thread-30", "execution_time": 0.4248692989349365, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.769685Z", "completed_at": "2023-09-05T20:46:31.772187Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.772187Z", "completed_at": "2023-09-05T20:46:32.178171Z"}], "thread_id": "Thread-29", "execution_time": 0.5437321662902832, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.879232Z", "completed_at": "2023-09-05T20:46:31.888816Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.888816Z", "completed_at": "2023-09-05T20:46:32.348329Z"}], "thread_id": "Thread-28", "execution_time": 0.5691847801208496, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.998587Z", "completed_at": "2023-09-05T20:46:31.998587Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.005240Z", "completed_at": "2023-09-05T20:46:32.683289Z"}], "thread_id": "Thread-31", "execution_time": 0.7813005447387695, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185694a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.289639Z", "completed_at": "2023-09-05T20:46:32.309813Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.309813Z", "completed_at": "2023-09-05T20:46:32.978334Z"}], "thread_id": "Thread-30", "execution_time": 0.7899692058563232, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856952"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_hospice"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.322036Z", "completed_at": "2023-09-05T20:46:32.349426Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.349426Z", "completed_at": "2023-09-05T20:46:33.030296Z"}], "thread_id": "Thread-29", "execution_time": 0.8158533573150635, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185695a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_mastectomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.108613Z", "completed_at": "2023-09-05T20:46:32.185709Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.188739Z", "completed_at": "2023-09-05T20:46:33.047877Z"}], "thread_id": "Thread-33", "execution_time": 1.0408821105957031, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a46"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_advanced_illness"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.201637Z", "completed_at": "2023-09-05T20:46:32.239735Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.239735Z", "completed_at": "2023-09-05T20:46:33.038559Z"}], "thread_id": "Thread-27", "execution_time": 0.9607565402984619, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a42"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_dementia"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.458197Z", "completed_at": "2023-09-05T20:46:32.479784Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.488337Z", "completed_at": "2023-09-05T20:46:33.229369Z"}], "thread_id": "Thread-28", "execution_time": 0.8812990188598633, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a4e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclude_palliative"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.088682Z", "completed_at": "2023-09-05T20:46:33.099266Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.099266Z", "completed_at": "2023-09-05T20:46:33.499269Z"}], "thread_id": "Thread-30", "execution_time": 0.5099301338195801, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.141777Z", "completed_at": "2023-09-05T20:46:33.145836Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.145836Z", "completed_at": "2023-09-05T20:46:33.488712Z"}], "thread_id": "Thread-29", "execution_time": 0.45777320861816406, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.788593Z", "completed_at": "2023-09-05T20:46:32.818420Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.818420Z", "completed_at": "2023-09-05T20:46:33.482195Z"}], "thread_id": "Thread-31", "execution_time": 0.8111293315887451, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185696e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_numerator"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.159566Z", "completed_at": "2023-09-05T20:46:33.168593Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.168593Z", "completed_at": "2023-09-05T20:46:33.522083Z"}], "thread_id": "Thread-33", "execution_time": 0.47902655601501465, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.165082Z", "completed_at": "2023-09-05T20:46:33.172177Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.172177Z", "completed_at": "2023-09-05T20:46:33.978618Z"}], "thread_id": "Thread-27", "execution_time": 0.909081220626831, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a5a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.649769Z", "completed_at": "2023-09-05T20:46:33.655294Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.655294Z", "completed_at": "2023-09-05T20:46:34.068647Z"}], "thread_id": "Thread-33", "execution_time": 0.5085844993591309, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.628643Z", "completed_at": "2023-09-05T20:46:33.629605Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.638627Z", "completed_at": "2023-09-05T20:46:34.059926Z"}], "thread_id": "Thread-31", "execution_time": 0.5362451076507568, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.609490Z", "completed_at": "2023-09-05T20:46:33.609490Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.622108Z", "completed_at": "2023-09-05T20:46:34.198591Z"}], "thread_id": "Thread-30", "execution_time": 0.6904382705688477, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185699a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.338988Z", "completed_at": "2023-09-05T20:46:33.771995Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.771995Z", "completed_at": "2023-09-05T20:46:34.349843Z"}], "thread_id": "Thread-28", "execution_time": 1.1010801792144775, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a62"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:33.617523Z", "completed_at": "2023-09-05T20:46:33.628643Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:33.629605Z", "completed_at": "2023-09-05T20:46:34.459725Z"}], "thread_id": "Thread-29", "execution_time": 0.9960877895355225, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a6e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:31.488606Z", "completed_at": "2023-09-05T20:46:31.944892Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:31.944892Z", "completed_at": "2023-09-05T20:46:34.783522Z"}], "thread_id": "Thread-34", "execution_time": 3.3896586894989014, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a2e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__wide_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.307721Z", "completed_at": "2023-09-05T20:46:34.318358Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.318358Z", "completed_at": "2023-09-05T20:46:34.972078Z"}], "thread_id": "Thread-31", "execution_time": 0.7729730606079102, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569aa"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.309696Z", "completed_at": "2023-09-05T20:46:34.318358Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.321922Z", "completed_at": "2023-09-05T20:46:34.988566Z"}], "thread_id": "Thread-30", "execution_time": 0.7941939830780029, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a86"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.447586Z", "completed_at": "2023-09-05T20:46:34.450456Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.450456Z", "completed_at": "2023-09-05T20:46:34.997593Z"}], "thread_id": "Thread-28", "execution_time": 0.671074628829956, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a8a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.159403Z", "completed_at": "2023-09-05T20:46:34.198591Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.198591Z", "completed_at": "2023-09-05T20:46:35.080082Z"}], "thread_id": "Thread-33", "execution_time": 1.018786907196045, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a82"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.079390Z", "completed_at": "2023-09-05T20:46:34.080478Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.080478Z", "completed_at": "2023-09-05T20:46:35.119775Z"}], "thread_id": "Thread-27", "execution_time": 1.149359941482544, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a7a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.609207Z", "completed_at": "2023-09-05T20:46:34.618428Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.621951Z", "completed_at": "2023-09-05T20:46:35.219467Z"}], "thread_id": "Thread-29", "execution_time": 0.7190027236938477, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855a92"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:34.878265Z", "completed_at": "2023-09-05T20:46:34.889670Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:34.889670Z", "completed_at": "2023-09-05T20:46:35.328210Z"}], "thread_id": "Thread-34", "execution_time": 0.6439652442932129, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.088609Z", "completed_at": "2023-09-05T20:46:35.098569Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.098569Z", "completed_at": "2023-09-05T20:46:35.471980Z"}], "thread_id": "Thread-31", "execution_time": 0.4911623001098633, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.190209Z", "completed_at": "2023-09-05T20:46:35.190209Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.190209Z", "completed_at": "2023-09-05T20:46:35.626060Z"}], "thread_id": "Thread-33", "execution_time": 0.531982421875, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.229818Z", "completed_at": "2023-09-05T20:46:35.229818Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.229818Z", "completed_at": "2023-09-05T20:46:35.748363Z"}], "thread_id": "Thread-27", "execution_time": 0.6181864738464355, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.128564Z", "completed_at": "2023-09-05T20:46:35.139342Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.142346Z", "completed_at": "2023-09-05T20:46:35.810420Z"}], "thread_id": "Thread-28", "execution_time": 0.7815828323364258, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569c2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.328210Z", "completed_at": "2023-09-05T20:46:35.340246Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.340246Z", "completed_at": "2023-09-05T20:46:35.840281Z"}], "thread_id": "Thread-29", "execution_time": 0.6102979183197021, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.529302Z", "completed_at": "2023-09-05T20:46:35.532351Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.532351Z", "completed_at": "2023-09-05T20:46:35.869544Z"}], "thread_id": "Thread-34", "execution_time": 0.4438161849975586, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.111572Z", "completed_at": "2023-09-05T20:46:35.118661Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.122284Z", "completed_at": "2023-09-05T20:46:36.129917Z"}], "thread_id": "Thread-30", "execution_time": 1.113882064819336, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569c6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.589393Z", "completed_at": "2023-09-05T20:46:35.626060Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.629818Z", "completed_at": "2023-09-05T20:46:36.388560Z"}], "thread_id": "Thread-31", "execution_time": 0.8889575004577637, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569d6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__int_nqf2372_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.977605Z", "completed_at": "2023-09-05T20:46:35.979607Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.984118Z", "completed_at": "2023-09-05T20:46:36.618719Z"}], "thread_id": "Thread-28", "execution_time": 0.758610725402832, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569de"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:36.259584Z", "completed_at": "2023-09-05T20:46:36.268183Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:36.272364Z", "completed_at": "2023-09-05T20:46:36.988612Z"}], "thread_id": "Thread-30", "execution_time": 0.8522853851318359, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569ee"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:36.248717Z", "completed_at": "2023-09-05T20:46:36.268183Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:36.272364Z", "completed_at": "2023-09-05T20:46:37.008681Z"}], "thread_id": "Thread-27", "execution_time": 0.8755075931549072, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569f2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:36.241120Z", "completed_at": "2023-09-05T20:46:36.259584Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:36.272364Z", "completed_at": "2023-09-05T20:46:37.136748Z"}], "thread_id": "Thread-34", "execution_time": 0.9926731586456299, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569f6"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:36.237528Z", "completed_at": "2023-09-05T20:46:36.259584Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:36.268183Z", "completed_at": "2023-09-05T20:46:37.138849Z"}], "thread_id": "Thread-29", "execution_time": 1.0023159980773926, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855ac2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:36.488995Z", "completed_at": "2023-09-05T20:46:36.491847Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:36.491847Z", "completed_at": "2023-09-05T20:46:37.207878Z"}], "thread_id": "Thread-31", "execution_time": 0.8107147216796875, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e183018569fa"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__summary_long"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:36.928564Z", "completed_at": "2023-09-05T20:46:36.934340Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:36.934340Z", "completed_at": "2023-09-05T20:46:37.390665Z"}], "thread_id": "Thread-28", "execution_time": 0.561621904373169, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:37.085833Z", "completed_at": "2023-09-05T20:46:37.089733Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:37.089733Z", "completed_at": "2023-09-05T20:46:37.418501Z"}], "thread_id": "Thread-30", "execution_time": 0.424816370010376, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:37.108668Z", "completed_at": "2023-09-05T20:46:37.110586Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:37.110586Z", "completed_at": "2023-09-05T20:46:37.490187Z"}], "thread_id": "Thread-27", "execution_time": 0.47245049476623535, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:37.228243Z", "completed_at": "2023-09-05T20:46:37.231827Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:37.231827Z", "completed_at": "2023-09-05T20:46:37.581118Z"}], "thread_id": "Thread-34", "execution_time": 0.4518091678619385, "adapter_response": {}, "message": null, "failures": 0, "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": "2023-09-05T20:46:37.299282Z", "completed_at": "2023-09-05T20:46:37.308342Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:37.308342Z", "completed_at": "2023-09-05T20:46:37.972414Z"}], "thread_id": "Thread-31", "execution_time": 0.8786976337432861, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856a0a"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__summary_counts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:35.918172Z", "completed_at": "2023-09-05T20:46:35.922352Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:35.922352Z", "completed_at": "2023-09-05T20:46:38.093727Z"}], "thread_id": "Thread-33", "execution_time": 2.3623476028442383, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855abe"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:37.501301Z", "completed_at": "2023-09-05T20:46:37.508414Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:37.508414Z", "completed_at": "2023-09-05T20:46:38.193939Z"}], "thread_id": "Thread-28", "execution_time": 0.7887303829193115, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856a16"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.quality_measures_reporting__summary_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:37.239456Z", "completed_at": "2023-09-05T20:46:37.249423Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:37.249423Z", "completed_at": "2023-09-05T20:46:38.228229Z"}], "thread_id": "Thread-29", "execution_time": 1.1100883483886719, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855af2"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:37.691778Z", "completed_at": "2023-09-05T20:46:38.193939Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:38.199487Z", "completed_at": "2023-09-05T20:46:38.744893Z"}], "thread_id": "Thread-30", "execution_time": 1.1487085819244385, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e18301856a26"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:38.288329Z", "completed_at": "2023-09-05T20:46:38.290031Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:38.290031Z", "completed_at": "2023-09-05T20:46:39.213926Z"}], "thread_id": "Thread-34", "execution_time": 1.0307049751281738, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855b06"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:38.860873Z", "completed_at": "2023-09-05T20:46:38.863389Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:38.868542Z", "completed_at": "2023-09-05T20:46:39.330000Z"}], "thread_id": "Thread-29", "execution_time": 0.5975403785705566, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:38.848312Z", "completed_at": "2023-09-05T20:46:38.863389Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:38.863389Z", "completed_at": "2023-09-05T20:46:39.338623Z"}], "thread_id": "Thread-28", "execution_time": 0.6112751960754395, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:38.358204Z", "completed_at": "2023-09-05T20:46:38.358204Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:38.358204Z", "completed_at": "2023-09-05T20:46:39.448382Z"}], "thread_id": "Thread-31", "execution_time": 1.1977477073669434, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be2c-0057-e18301855b0e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:39.559371Z", "completed_at": "2023-09-05T20:46:39.572114Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:39.572114Z", "completed_at": "2023-09-05T20:46:39.950292Z"}], "thread_id": "Thread-30", "execution_time": 0.49674534797668457, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:38.367496Z", "completed_at": "2023-09-05T20:46:38.369597Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:38.372107Z", "completed_at": "2023-09-05T20:46:40.942187Z"}], "thread_id": "Thread-33", "execution_time": 2.6902341842651367, "adapter_response": {"_message": "SUCCESS 0", "code": "SUCCESS", "rows_affected": 0, "query_id": "01aecafe-0603-be0f-0057-e18301856a5a"}, "message": "SUCCESS 0", "failures": null, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:40.058652Z", "completed_at": "2023-09-05T20:46:40.069775Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:40.069775Z", "completed_at": "2023-09-05T20:46:42.290130Z"}], "thread_id": "Thread-34", "execution_time": 2.355259895324707, "adapter_response": {"_message": "SUCCESS 0", "code": "SUCCESS", "rows_affected": 0, "query_id": "01aecafe-0603-be2c-0057-e18301855b6a"}, "message": "SUCCESS 0", "failures": null, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-05T20:46:32.078452Z", "completed_at": "2023-09-05T20:46:32.578400Z"}, {"name": "execute", "started_at": "2023-09-05T20:46:32.578400Z", "completed_at": "2023-09-05T20:46:45.868664Z"}], "thread_id": "Thread-32", "execution_time": 13.883060693740845, "adapter_response": {"_message": "SUCCESS 1", "code": "SUCCESS", "rows_affected": 1, "query_id": "01aecafe-0603-be0f-0057-e1830185695e"}, "message": "SUCCESS 1", "failures": null, "unique_id": "model.the_tuva_project.ccsr__wide_condition_category"}], "elapsed_time": 72.14234948158264, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "C:\\Users\\forre\\.dbt", "send_anonymous_usage_stats": true, "quiet": false, "no_print": false, "cache_selected_only": false, "indirect_selection": "eager", "resource_types": [], "which": "build", "rpc_method": "build"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.4.5", "generated_at": "2023-09-12T13:15:55.208929Z", "invocation_id": "d3420436-3f9f-40f8-9264-25572b056af6", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.988806Z", "completed_at": "2023-09-12T13:15:50.999043Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.003121Z", "completed_at": "2023-09-12T13:15:51.003121Z"}], "thread_id": "Thread-14", "execution_time": 0.023588895797729492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.988806Z", "completed_at": "2023-09-12T13:15:50.999043Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-15", "execution_time": 0.022587299346923828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.995416Z", "completed_at": "2023-09-12T13:15:51.003121Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-16", "execution_time": 0.021556854248046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.995416Z", "completed_at": "2023-09-12T13:15:51.003121Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-18", "execution_time": 0.019938230514526367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.995416Z", "completed_at": "2023-09-12T13:15:51.003121Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-17", "execution_time": 0.021556854248046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.999043Z", "completed_at": "2023-09-12T13:15:51.003121Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-19", "execution_time": 0.019835710525512695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:50.999043Z", "completed_at": "2023-09-12T13:15:51.003121Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-20", "execution_time": 0.019835710525512695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.003121Z", "completed_at": "2023-09-12T13:15:51.003121Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.008642Z", "completed_at": "2023-09-12T13:15:51.008642Z"}], "thread_id": "Thread-21", "execution_time": 0.019835710525512695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.028703Z", "completed_at": "2023-09-12T13:15:51.028703Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.037566Z", "completed_at": "2023-09-12T13:15:51.037566Z"}], "thread_id": "Thread-17", "execution_time": 0.020531654357910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.eligibility_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.028703Z", "completed_at": "2023-09-12T13:15:51.028703Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.037566Z", "completed_at": "2023-09-12T13:15:51.037566Z"}], "thread_id": "Thread-19", "execution_time": 0.020531654357910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.medical_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.018637Z", "completed_at": "2023-09-12T13:15:51.028703Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.037566Z", "completed_at": "2023-09-12T13:15:51.037566Z"}], "thread_id": "Thread-14", "execution_time": 0.030526399612426758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.028703Z", "completed_at": "2023-09-12T13:15:51.028703Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.037566Z", "completed_at": "2023-09-12T13:15:51.037566Z"}], "thread_id": "Thread-20", "execution_time": 0.020531654357910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.pharmacy_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.018637Z", "completed_at": "2023-09-12T13:15:51.028703Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.038641Z", "completed_at": "2023-09-12T13:15:51.038641Z"}], "thread_id": "Thread-15", "execution_time": 0.020531654357910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.018637Z", "completed_at": "2023-09-12T13:15:51.034518Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.038641Z", "completed_at": "2023-09-12T13:15:51.038641Z"}], "thread_id": "Thread-16", "execution_time": 0.020531654357910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.034518Z", "completed_at": "2023-09-12T13:15:51.035021Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.039168Z", "completed_at": "2023-09-12T13:15:51.039168Z"}], "thread_id": "Thread-21", "execution_time": 0.020531654357910156, "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": "2023-09-12T13:15:51.018637Z", "completed_at": "2023-09-12T13:15:51.035689Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.039168Z", "completed_at": "2023-09-12T13:15:51.039168Z"}], "thread_id": "Thread-18", "execution_time": 0.020531654357910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.048685Z", "completed_at": "2023-09-12T13:15:51.053554Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.065121Z", "completed_at": "2023-09-12T13:15:51.065121Z"}], "thread_id": "Thread-17", "execution_time": 0.02794623374938965, "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": "2023-09-12T13:15:51.053554Z", "completed_at": "2023-09-12T13:15:51.054555Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.065121Z", "completed_at": "2023-09-12T13:15:51.065121Z"}], "thread_id": "Thread-19", "execution_time": 0.02794623374938965, "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": "2023-09-12T13:15:51.054555Z", "completed_at": "2023-09-12T13:15:51.055550Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.065121Z", "completed_at": "2023-09-12T13:15:51.065121Z"}], "thread_id": "Thread-14", "execution_time": 0.02794623374938965, "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": "2023-09-12T13:15:51.056555Z", "completed_at": "2023-09-12T13:15:51.057544Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.065121Z", "completed_at": "2023-09-12T13:15:51.065121Z"}], "thread_id": "Thread-20", "execution_time": 0.0199434757232666, "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": "2023-09-12T13:15:51.058540Z", "completed_at": "2023-09-12T13:15:51.059133Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.065121Z", "completed_at": "2023-09-12T13:15:51.065121Z"}], "thread_id": "Thread-15", "execution_time": 0.0199434757232666, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.059133Z", "completed_at": "2023-09-12T13:15:51.060139Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.066146Z", "completed_at": "2023-09-12T13:15:51.066146Z"}], "thread_id": "Thread-16", "execution_time": 0.02109384536743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.060139Z", "completed_at": "2023-09-12T13:15:51.061213Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.066146Z", "completed_at": "2023-09-12T13:15:51.066146Z"}], "thread_id": "Thread-21", "execution_time": 0.021977901458740234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.061213Z", "completed_at": "2023-09-12T13:15:51.062212Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.066146Z", "completed_at": "2023-09-12T13:15:51.066146Z"}], "thread_id": "Thread-18", "execution_time": 0.021977901458740234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.079154Z", "completed_at": "2023-09-12T13:15:51.081154Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-17", "execution_time": 0.014078855514526367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.081154Z", "completed_at": "2023-09-12T13:15:51.082161Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-19", "execution_time": 0.014078855514526367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.082161Z", "completed_at": "2023-09-12T13:15:51.083156Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-14", "execution_time": 0.01981949806213379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.083156Z", "completed_at": "2023-09-12T13:15:51.085140Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-20", "execution_time": 0.01981949806213379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.085140Z", "completed_at": "2023-09-12T13:15:51.086137Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-15", "execution_time": 0.01981949806213379, "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": "2023-09-12T13:15:51.086137Z", "completed_at": "2023-09-12T13:15:51.087223Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-16", "execution_time": 0.01882314682006836, "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": "2023-09-12T13:15:51.087223Z", "completed_at": "2023-09-12T13:15:51.088728Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-21", "execution_time": 0.01882314682006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.data_profiling__test_catalog"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.088728Z", "completed_at": "2023-09-12T13:15:51.088728Z"}], "thread_id": "Thread-18", "execution_time": 0.017824649810791016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.102984Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-17", "execution_time": 0.019900798797607422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-19", "execution_time": 0.019900798797607422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-14", "execution_time": 0.0158846378326416, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-20", "execution_time": 0.0158846378326416, "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": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-15", "execution_time": 0.0158846378326416, "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": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-16", "execution_time": 0.0158846378326416, "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": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-21", "execution_time": 0.0158846378326416, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.108488Z", "completed_at": "2023-09-12T13:15:51.108488Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.118868Z", "completed_at": "2023-09-12T13:15:51.118868Z"}], "thread_id": "Thread-18", "execution_time": 0.0158846378326416, "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": "2023-09-12T13:15:51.134484Z", "completed_at": "2023-09-12T13:15:51.134484Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}], "thread_id": "Thread-17", "execution_time": 0.021380901336669922, "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": "2023-09-12T13:15:51.134484Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.148680Z", "completed_at": "2023-09-12T13:15:51.148680Z"}], "thread_id": "Thread-19", "execution_time": 0.021380901336669922, "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": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.148680Z", "completed_at": "2023-09-12T13:15:51.148680Z"}], "thread_id": "Thread-14", "execution_time": 0.021380901336669922, "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": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.148680Z", "completed_at": "2023-09-12T13:15:51.148680Z"}], "thread_id": "Thread-20", "execution_time": 0.021380901336669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.148680Z", "completed_at": "2023-09-12T13:15:51.148680Z"}], "thread_id": "Thread-15", "execution_time": 0.021380901336669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.148680Z", "completed_at": "2023-09-12T13:15:51.148680Z"}], "thread_id": "Thread-16", "execution_time": 0.021380901336669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.150208Z", "completed_at": "2023-09-12T13:15:51.150208Z"}], "thread_id": "Thread-21", "execution_time": 0.021380901336669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.138499Z", "completed_at": "2023-09-12T13:15:51.138499Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.150208Z", "completed_at": "2023-09-12T13:15:51.150208Z"}], "thread_id": "Thread-18", "execution_time": 0.021380901336669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.158712Z", "completed_at": "2023-09-12T13:15:51.158712Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-17", "execution_time": 0.01988959312438965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.158712Z", "completed_at": "2023-09-12T13:15:51.165855Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-19", "execution_time": 0.01988959312438965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.165855Z", "completed_at": "2023-09-12T13:15:51.165855Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-14", "execution_time": 0.01988959312438965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-20", "execution_time": 0.01988959312438965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__calendar"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-15", "execution_time": 0.022913694381713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-16", "execution_time": 0.02329254150390625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__code_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}], "thread_id": "Thread-21", "execution_time": 0.0236203670501709, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.168863Z", "completed_at": "2023-09-12T13:15:51.168863Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.178602Z", "completed_at": "2023-09-12T13:15:51.178602Z"}], "thread_id": "Thread-18", "execution_time": 0.024122238159179688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.191710Z", "completed_at": "2023-09-12T13:15:51.192693Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.204965Z", "completed_at": "2023-09-12T13:15:51.204965Z"}], "thread_id": "Thread-17", "execution_time": 0.020768404006958008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.193689Z", "completed_at": "2023-09-12T13:15:51.193689Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.204965Z", "completed_at": "2023-09-12T13:15:51.204965Z"}], "thread_id": "Thread-19", "execution_time": 0.019768238067626953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.193689Z", "completed_at": "2023-09-12T13:15:51.196207Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.204965Z", "completed_at": "2023-09-12T13:15:51.204965Z"}], "thread_id": "Thread-14", "execution_time": 0.021270275115966797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.196207Z", "completed_at": "2023-09-12T13:15:51.197824Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.205965Z", "completed_at": "2023-09-12T13:15:51.205965Z"}], "thread_id": "Thread-20", "execution_time": 0.021270275115966797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.198327Z", "completed_at": "2023-09-12T13:15:51.198931Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.205965Z", "completed_at": "2023-09-12T13:15:51.205965Z"}], "thread_id": "Thread-15", "execution_time": 0.020777225494384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.198931Z", "completed_at": "2023-09-12T13:15:51.199944Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.205965Z", "completed_at": "2023-09-12T13:15:51.205965Z"}], "thread_id": "Thread-16", "execution_time": 0.020777225494384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.199944Z", "completed_at": "2023-09-12T13:15:51.200926Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.205965Z", "completed_at": "2023-09-12T13:15:51.205965Z"}], "thread_id": "Thread-21", "execution_time": 0.01976943016052246, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.200926Z", "completed_at": "2023-09-12T13:15:51.201953Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.206961Z", "completed_at": "2023-09-12T13:15:51.206961Z"}], "thread_id": "Thread-18", "execution_time": 0.02127671241760254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.219693Z", "completed_at": "2023-09-12T13:15:51.220765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-17", "execution_time": 0.01499629020690918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__mdc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.220765Z", "completed_at": "2023-09-12T13:15:51.220765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-19", "execution_time": 0.014011859893798828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.220765Z", "completed_at": "2023-09-12T13:15:51.220765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-14", "execution_time": 0.014011859893798828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.220765Z", "completed_at": "2023-09-12T13:15:51.220765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-20", "execution_time": 0.020613908767700195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.220765Z", "completed_at": "2023-09-12T13:15:51.220765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-15", "execution_time": 0.020613908767700195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.220765Z", "completed_at": "2023-09-12T13:15:51.220765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-16", "execution_time": 0.019617557525634766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.220765Z", "completed_at": "2023-09-12T13:15:51.228990Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-21", "execution_time": 0.019617557525634766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.228990Z", "completed_at": "2023-09-12T13:15:51.228990Z"}], "thread_id": "Thread-18", "execution_time": 0.021619796752929688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.238591Z", "completed_at": "2023-09-12T13:15:51.248719Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.278982Z", "completed_at": "2023-09-12T13:15:51.278982Z"}], "thread_id": "Thread-17", "execution_time": 0.0403904914855957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__provider"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.248789Z", "completed_at": "2023-09-12T13:15:51.248789Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.278982Z", "completed_at": "2023-09-12T13:15:51.278982Z"}], "thread_id": "Thread-19", "execution_time": 0.04625344276428223, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.248789Z", "completed_at": "2023-09-12T13:15:51.248789Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.278982Z", "completed_at": "2023-09-12T13:15:51.278982Z"}], "thread_id": "Thread-14", "execution_time": 0.04727435111999512, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.248789Z", "completed_at": "2023-09-12T13:15:51.252292Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.278982Z", "completed_at": "2023-09-12T13:15:51.278982Z"}], "thread_id": "Thread-20", "execution_time": 0.04727435111999512, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.252292Z", "completed_at": "2023-09-12T13:15:51.278982Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.285866Z", "completed_at": "2023-09-12T13:15:51.285866Z"}], "thread_id": "Thread-15", "execution_time": 0.05162811279296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.268907Z", "completed_at": "2023-09-12T13:15:51.278982Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.287855Z", "completed_at": "2023-09-12T13:15:51.287855Z"}], "thread_id": "Thread-18", "execution_time": 0.05370616912841797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.296864Z", "completed_at": "2023-09-12T13:15:51.338786Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-16", "execution_time": 0.06817984580993652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.306212Z", "completed_at": "2023-09-12T13:15:51.338786Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-21", "execution_time": 0.06773614883422852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.315976Z", "completed_at": "2023-09-12T13:15:51.338786Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-17", "execution_time": 0.06718683242797852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.319695Z", "completed_at": "2023-09-12T13:15:51.338786Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-19", "execution_time": 0.06610870361328125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.324748Z", "completed_at": "2023-09-12T13:15:51.348997Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-14", "execution_time": 0.06568455696105957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.332648Z", "completed_at": "2023-09-12T13:15:51.348997Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-20", "execution_time": 0.06568455696105957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.338786Z", "completed_at": "2023-09-12T13:15:51.358950Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-15", "execution_time": 0.07307720184326172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.348997Z", "completed_at": "2023-09-12T13:15:51.358950Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.358950Z", "completed_at": "2023-09-12T13:15:51.358950Z"}], "thread_id": "Thread-18", "execution_time": 0.05268692970275879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.378386Z", "completed_at": "2023-09-12T13:15:51.408577Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.428789Z", "completed_at": "2023-09-12T13:15:51.428789Z"}], "thread_id": "Thread-21", "execution_time": 0.057984113693237305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__date_issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.386603Z", "completed_at": "2023-09-12T13:15:51.408577Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.428789Z", "completed_at": "2023-09-12T13:15:51.428789Z"}], "thread_id": "Thread-17", "execution_time": 0.0634152889251709, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__medical_claim_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.408577Z", "completed_at": "2023-09-12T13:15:51.418888Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.428789Z", "completed_at": "2023-09-12T13:15:51.428789Z"}], "thread_id": "Thread-20", "execution_time": 0.06376409530639648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__claim_type_mapping_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.418888Z", "completed_at": "2023-09-12T13:15:51.428789Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.435148Z", "completed_at": "2023-09-12T13:15:51.435148Z"}], "thread_id": "Thread-15", "execution_time": 0.08827996253967285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__claim_type_unmapped"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.418888Z", "completed_at": "2023-09-12T13:15:51.428789Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.435148Z", "completed_at": "2023-09-12T13:15:51.435148Z"}], "thread_id": "Thread-18", "execution_time": 0.08349847793579102, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.438803Z", "completed_at": "2023-09-12T13:15:51.471629Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.488416Z", "completed_at": "2023-09-12T13:15:51.488416Z"}], "thread_id": "Thread-16", "execution_time": 0.06711101531982422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.462909Z", "completed_at": "2023-09-12T13:15:51.471629Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.488416Z", "completed_at": "2023-09-12T13:15:51.488416Z"}], "thread_id": "Thread-19", "execution_time": 0.0638282299041748, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.465912Z", "completed_at": "2023-09-12T13:15:51.471629Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.495900Z", "completed_at": "2023-09-12T13:15:51.495900Z"}], "thread_id": "Thread-14", "execution_time": 0.0638282299041748, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.471629Z", "completed_at": "2023-09-12T13:15:51.488416Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.503498Z", "completed_at": "2023-09-12T13:15:51.503498Z"}], "thread_id": "Thread-21", "execution_time": 0.04231595993041992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.478739Z", "completed_at": "2023-09-12T13:15:51.488416Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.503498Z", "completed_at": "2023-09-12T13:15:51.503498Z"}], "thread_id": "Thread-17", "execution_time": 0.04614663124084473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.478739Z", "completed_at": "2023-09-12T13:15:51.498976Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.508564Z", "completed_at": "2023-09-12T13:15:51.508564Z"}], "thread_id": "Thread-20", "execution_time": 0.03693509101867676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__professional_header_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.508564Z", "completed_at": "2023-09-12T13:15:51.538739Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.563118Z", "completed_at": "2023-09-12T13:15:51.563118Z"}], "thread_id": "Thread-16", "execution_time": 0.06684160232543945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.518819Z", "completed_at": "2023-09-12T13:15:51.539543Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.569306Z", "completed_at": "2023-09-12T13:15:51.569306Z"}], "thread_id": "Thread-19", "execution_time": 0.06484031677246094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.528435Z", "completed_at": "2023-09-12T13:15:51.548477Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.571362Z", "completed_at": "2023-09-12T13:15:51.571362Z"}], "thread_id": "Thread-14", "execution_time": 0.06661057472229004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.539543Z", "completed_at": "2023-09-12T13:15:51.563118Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.574876Z", "completed_at": "2023-09-12T13:15:51.574876Z"}], "thread_id": "Thread-15", "execution_time": 0.05801510810852051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__claims_without_enrollment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.539543Z", "completed_at": "2023-09-12T13:15:51.564351Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.575700Z", "completed_at": "2023-09-12T13:15:51.575700Z"}], "thread_id": "Thread-21", "execution_time": 0.05969834327697754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__duplicate_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.548477Z", "completed_at": "2023-09-12T13:15:51.569306Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.575981Z", "completed_at": "2023-09-12T13:15:51.575981Z"}], "thread_id": "Thread-18", "execution_time": 0.06071352958679199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__pharmacy_claim_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.564627Z", "completed_at": "2023-09-12T13:15:51.572335Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.579533Z", "completed_at": "2023-09-12T13:15:51.579533Z"}], "thread_id": "Thread-20", "execution_time": 0.043260812759399414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.583659Z", "completed_at": "2023-09-12T13:15:51.603586Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.618890Z", "completed_at": "2023-09-12T13:15:51.618890Z"}], "thread_id": "Thread-16", "execution_time": 0.10204696655273438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.588450Z", "completed_at": "2023-09-12T13:15:51.603586Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.678881Z", "completed_at": "2023-09-12T13:15:51.678881Z"}], "thread_id": "Thread-19", "execution_time": 0.10431241989135742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.598496Z", "completed_at": "2023-09-12T13:15:51.618890Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.678881Z", "completed_at": "2023-09-12T13:15:51.678881Z"}], "thread_id": "Thread-14", "execution_time": 0.10335421562194824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.603586Z", "completed_at": "2023-09-12T13:15:51.618890Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.684312Z", "completed_at": "2023-09-12T13:15:51.684312Z"}], "thread_id": "Thread-15", "execution_time": 0.09987020492553711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.613806Z", "completed_at": "2023-09-12T13:15:51.618890Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.686182Z", "completed_at": "2023-09-12T13:15:51.686182Z"}], "thread_id": "Thread-21", "execution_time": 0.10046005249023438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.618890Z", "completed_at": "2023-09-12T13:15:51.678881Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.686487Z", "completed_at": "2023-09-12T13:15:51.686487Z"}], "thread_id": "Thread-18", "execution_time": 0.10046005249023438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.618890Z", "completed_at": "2023-09-12T13:15:51.684123Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.688910Z", "completed_at": "2023-09-12T13:15:51.688910Z"}], "thread_id": "Thread-20", "execution_time": 0.09878802299499512, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.688910Z", "completed_at": "2023-09-12T13:15:51.720730Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.733809Z", "completed_at": "2023-09-12T13:15:51.733809Z"}], "thread_id": "Thread-17", "execution_time": 0.06852388381958008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__eligibility_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.702858Z", "completed_at": "2023-09-12T13:15:51.729911Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.758696Z", "completed_at": "2023-09-12T13:15:51.758696Z"}], "thread_id": "Thread-16", "execution_time": 0.06978583335876465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.721999Z", "completed_at": "2023-09-12T13:15:51.731791Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.758696Z", "completed_at": "2023-09-12T13:15:51.758696Z"}], "thread_id": "Thread-19", "execution_time": 0.06978583335876465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.726148Z", "completed_at": "2023-09-12T13:15:51.734706Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.758696Z", "completed_at": "2023-09-12T13:15:51.758696Z"}], "thread_id": "Thread-14", "execution_time": 0.06000161170959473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.731791Z", "completed_at": "2023-09-12T13:15:51.753111Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.768571Z", "completed_at": "2023-09-12T13:15:51.768571Z"}], "thread_id": "Thread-15", "execution_time": 0.06670522689819336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.734706Z", "completed_at": "2023-09-12T13:15:51.758696Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.769079Z", "completed_at": "2023-09-12T13:15:51.769079Z"}], "thread_id": "Thread-21", "execution_time": 0.048348426818847656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.743462Z", "completed_at": "2023-09-12T13:15:51.758696Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.769079Z", "completed_at": "2023-09-12T13:15:51.769079Z"}], "thread_id": "Thread-18", "execution_time": 0.048348426818847656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.758696Z", "completed_at": "2023-09-12T13:15:51.768571Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.778462Z", "completed_at": "2023-09-12T13:15:51.778462Z"}], "thread_id": "Thread-20", "execution_time": 0.04775714874267578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.769079Z", "completed_at": "2023-09-12T13:15:51.778462Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.802103Z", "completed_at": "2023-09-12T13:15:51.802103Z"}], "thread_id": "Thread-17", "execution_time": 0.1418755054473877, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.784220Z", "completed_at": "2023-09-12T13:15:51.800109Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.900571Z", "completed_at": "2023-09-12T13:15:51.900571Z"}], "thread_id": "Thread-16", "execution_time": 0.1397380828857422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.790078Z", "completed_at": "2023-09-12T13:15:51.801108Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.900571Z", "completed_at": "2023-09-12T13:15:51.900571Z"}], "thread_id": "Thread-19", "execution_time": 0.1397380828857422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.794273Z", "completed_at": "2023-09-12T13:15:51.801108Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.908817Z", "completed_at": "2023-09-12T13:15:51.908817Z"}], "thread_id": "Thread-14", "execution_time": 0.1303548812866211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.802103Z", "completed_at": "2023-09-12T13:15:51.900571Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.908817Z", "completed_at": "2023-09-12T13:15:51.908817Z"}], "thread_id": "Thread-15", "execution_time": 0.14022183418273926, "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": "2023-09-12T13:15:51.835470Z", "completed_at": "2023-09-12T13:15:51.900571Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.916629Z", "completed_at": "2023-09-12T13:15:51.916629Z"}], "thread_id": "Thread-21", "execution_time": 0.12971806526184082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.841712Z", "completed_at": "2023-09-12T13:15:51.900571Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.916629Z", "completed_at": "2023-09-12T13:15:51.916629Z"}], "thread_id": "Thread-18", "execution_time": 0.12971806526184082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.900571Z", "completed_at": "2023-09-12T13:15:51.908817Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.918684Z", "completed_at": "2023-09-12T13:15:51.918684Z"}], "thread_id": "Thread-20", "execution_time": 0.1272141933441162, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.918684Z", "completed_at": "2023-09-12T13:15:51.928322Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.952574Z", "completed_at": "2023-09-12T13:15:51.952574Z"}], "thread_id": "Thread-17", "execution_time": 0.04999804496765137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.928322Z", "completed_at": "2023-09-12T13:15:51.938628Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.958815Z", "completed_at": "2023-09-12T13:15:51.958815Z"}], "thread_id": "Thread-16", "execution_time": 0.053930044174194336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.935903Z", "completed_at": "2023-09-12T13:15:51.938628Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.958815Z", "completed_at": "2023-09-12T13:15:51.958815Z"}], "thread_id": "Thread-19", "execution_time": 0.05492377281188965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.938628Z", "completed_at": "2023-09-12T13:15:51.952574Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.971711Z", "completed_at": "2023-09-12T13:15:51.971711Z"}], "thread_id": "Thread-14", "execution_time": 0.05681133270263672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.938628Z", "completed_at": "2023-09-12T13:15:51.958815Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.975974Z", "completed_at": "2023-09-12T13:15:51.975974Z"}], "thread_id": "Thread-15", "execution_time": 0.05017542839050293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.952574Z", "completed_at": "2023-09-12T13:15:51.958815Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.976592Z", "completed_at": "2023-09-12T13:15:51.976592Z"}], "thread_id": "Thread-21", "execution_time": 0.04436612129211426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.958815Z", "completed_at": "2023-09-12T13:15:51.958815Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.976994Z", "completed_at": "2023-09-12T13:15:51.976994Z"}], "thread_id": "Thread-18", "execution_time": 0.04151320457458496, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.958815Z", "completed_at": "2023-09-12T13:15:51.974525Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:51.986197Z", "completed_at": "2023-09-12T13:15:51.986197Z"}], "thread_id": "Thread-20", "execution_time": 0.050119638442993164, "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": "2023-09-12T13:15:51.981200Z", "completed_at": "2023-09-12T13:15:51.989829Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.008340Z", "completed_at": "2023-09-12T13:15:52.008340Z"}], "thread_id": "Thread-17", "execution_time": 0.04454827308654785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.990775Z", "completed_at": "2023-09-12T13:15:52.008340Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.019073Z", "completed_at": "2023-09-12T13:15:52.019073Z"}], "thread_id": "Thread-16", "execution_time": 0.04944562911987305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:51.995855Z", "completed_at": "2023-09-12T13:15:52.008340Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.028523Z", "completed_at": "2023-09-12T13:15:52.028523Z"}], "thread_id": "Thread-19", "execution_time": 0.04838132858276367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.001626Z", "completed_at": "2023-09-12T13:15:52.019073Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.028523Z", "completed_at": "2023-09-12T13:15:52.028523Z"}], "thread_id": "Thread-14", "execution_time": 0.04804539680480957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.008340Z", "completed_at": "2023-09-12T13:15:52.019073Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.028523Z", "completed_at": "2023-09-12T13:15:52.028523Z"}], "thread_id": "Thread-15", "execution_time": 0.0467991828918457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.008340Z", "completed_at": "2023-09-12T13:15:52.019073Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.034637Z", "completed_at": "2023-09-12T13:15:52.034637Z"}], "thread_id": "Thread-21", "execution_time": 0.04284954071044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.019073Z", "completed_at": "2023-09-12T13:15:52.028523Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.035632Z", "completed_at": "2023-09-12T13:15:52.035632Z"}], "thread_id": "Thread-18", "execution_time": 0.04041409492492676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.019073Z", "completed_at": "2023-09-12T13:15:52.028523Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.038621Z", "completed_at": "2023-09-12T13:15:52.038621Z"}], "thread_id": "Thread-20", "execution_time": 0.03654670715332031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.040413Z", "completed_at": "2023-09-12T13:15:52.045846Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.058750Z", "completed_at": "2023-09-12T13:15:52.058750Z"}], "thread_id": "Thread-17", "execution_time": 0.05467867851257324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.046842Z", "completed_at": "2023-09-12T13:15:52.058750Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.088934Z", "completed_at": "2023-09-12T13:15:52.088934Z"}], "thread_id": "Thread-16", "execution_time": 0.0540008544921875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.051418Z", "completed_at": "2023-09-12T13:15:52.058750Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.089933Z", "completed_at": "2023-09-12T13:15:52.089933Z"}], "thread_id": "Thread-19", "execution_time": 0.05421280860900879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.claims_date_profiling__date_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.058750Z", "completed_at": "2023-09-12T13:15:52.068447Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.090798Z", "completed_at": "2023-09-12T13:15:52.090798Z"}], "thread_id": "Thread-14", "execution_time": 0.050894975662231445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.058750Z", "completed_at": "2023-09-12T13:15:52.084216Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.094538Z", "completed_at": "2023-09-12T13:15:52.094538Z"}], "thread_id": "Thread-15", "execution_time": 0.05201363563537598, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.058750Z", "completed_at": "2023-09-12T13:15:52.088934Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.094811Z", "completed_at": "2023-09-12T13:15:52.094811Z"}], "thread_id": "Thread-21", "execution_time": 0.05263090133666992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.074718Z", "completed_at": "2023-09-12T13:15:52.089933Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.095902Z", "completed_at": "2023-09-12T13:15:52.095902Z"}], "thread_id": "Thread-18", "execution_time": 0.04378557205200195, "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": "2023-09-12T13:15:52.084216Z", "completed_at": "2023-09-12T13:15:52.091625Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.098477Z", "completed_at": "2023-09-12T13:15:52.098477Z"}], "thread_id": "Thread-20", "execution_time": 0.04378557205200195, "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": "2023-09-12T13:15:52.099488Z", "completed_at": "2023-09-12T13:15:52.102536Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.128666Z", "completed_at": "2023-09-12T13:15:52.128666Z"}], "thread_id": "Thread-17", "execution_time": 0.04553103446960449, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.118912Z", "completed_at": "2023-09-12T13:15:52.138865Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.150378Z", "completed_at": "2023-09-12T13:15:52.150378Z"}], "thread_id": "Thread-15", "execution_time": 0.04784226417541504, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.128666Z", "completed_at": "2023-09-12T13:15:52.138865Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.150378Z", "completed_at": "2023-09-12T13:15:52.150378Z"}], "thread_id": "Thread-21", "execution_time": 0.049803972244262695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.134651Z", "completed_at": "2023-09-12T13:15:52.148875Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.150378Z", "completed_at": "2023-09-12T13:15:52.150378Z"}], "thread_id": "Thread-18", "execution_time": 0.05988049507141113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.138865Z", "completed_at": "2023-09-12T13:15:52.150378Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.158510Z", "completed_at": "2023-09-12T13:15:52.158510Z"}], "thread_id": "Thread-20", "execution_time": 0.059490203857421875, "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": "2023-09-12T13:15:52.150378Z", "completed_at": "2023-09-12T13:15:52.178403Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.188615Z", "completed_at": "2023-09-12T13:15:52.188615Z"}], "thread_id": "Thread-16", "execution_time": 0.04558372497558594, "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": "2023-09-12T13:15:52.158510Z", "completed_at": "2023-09-12T13:15:52.178403Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.188615Z", "completed_at": "2023-09-12T13:15:52.188615Z"}], "thread_id": "Thread-19", "execution_time": 0.04558372497558594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.209330Z", "completed_at": "2023-09-12T13:15:52.225960Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.249038Z", "completed_at": "2023-09-12T13:15:52.249038Z"}], "thread_id": "Thread-14", "execution_time": 0.05618739128112793, "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": "2023-09-12T13:15:52.219708Z", "completed_at": "2023-09-12T13:15:52.226253Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.252695Z", "completed_at": "2023-09-12T13:15:52.252695Z"}], "thread_id": "Thread-17", "execution_time": 0.05618739128112793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.233665Z", "completed_at": "2023-09-12T13:15:52.240547Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.258778Z", "completed_at": "2023-09-12T13:15:52.258778Z"}], "thread_id": "Thread-19", "execution_time": 0.04944801330566406, "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": "2023-09-12T13:15:52.227090Z", "completed_at": "2023-09-12T13:15:52.240547Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.258778Z", "completed_at": "2023-09-12T13:15:52.258778Z"}], "thread_id": "Thread-16", "execution_time": 0.04944801330566406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.240547Z", "completed_at": "2023-09-12T13:15:52.258778Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.258778Z", "completed_at": "2023-09-12T13:15:52.258778Z"}], "thread_id": "Thread-15", "execution_time": 0.04604196548461914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.249038Z", "completed_at": "2023-09-12T13:15:52.258778Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.269527Z", "completed_at": "2023-09-12T13:15:52.269527Z"}], "thread_id": "Thread-21", "execution_time": 0.04586315155029297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.252695Z", "completed_at": "2023-09-12T13:15:52.258778Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.272116Z", "completed_at": "2023-09-12T13:15:52.272116Z"}], "thread_id": "Thread-18", "execution_time": 0.044829607009887695, "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": "2023-09-12T13:15:52.258778Z", "completed_at": "2023-09-12T13:15:52.268847Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.276957Z", "completed_at": "2023-09-12T13:15:52.276957Z"}], "thread_id": "Thread-20", "execution_time": 0.04518461227416992, "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": "2023-09-12T13:15:52.273955Z", "completed_at": "2023-09-12T13:15:52.285772Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.306630Z", "completed_at": "2023-09-12T13:15:52.306630Z"}], "thread_id": "Thread-14", "execution_time": 0.05325150489807129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.278458Z", "completed_at": "2023-09-12T13:15:52.285772Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.307160Z", "completed_at": "2023-09-12T13:15:52.307160Z"}], "thread_id": "Thread-17", "execution_time": 0.04656577110290527, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_detail"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.296018Z", "completed_at": "2023-09-12T13:15:52.305522Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.315575Z", "completed_at": "2023-09-12T13:15:52.315575Z"}], "thread_id": "Thread-16", "execution_time": 0.049295663833618164, "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": "2023-09-12T13:15:52.285772Z", "completed_at": "2023-09-12T13:15:52.306040Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.316572Z", "completed_at": "2023-09-12T13:15:52.316572Z"}], "thread_id": "Thread-19", "execution_time": 0.050543785095214844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.301883Z", "completed_at": "2023-09-12T13:15:52.310876Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.323392Z", "completed_at": "2023-09-12T13:15:52.323392Z"}], "thread_id": "Thread-15", "execution_time": 0.041922807693481445, "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": "2023-09-12T13:15:52.307160Z", "completed_at": "2023-09-12T13:15:52.316572Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.326398Z", "completed_at": "2023-09-12T13:15:52.326398Z"}], "thread_id": "Thread-21", "execution_time": 0.04402589797973633, "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": "2023-09-12T13:15:52.317569Z", "completed_at": "2023-09-12T13:15:52.325670Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.338454Z", "completed_at": "2023-09-12T13:15:52.338454Z"}], "thread_id": "Thread-20", "execution_time": 0.0322418212890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.330796Z", "completed_at": "2023-09-12T13:15:52.338454Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.388463Z", "completed_at": "2023-09-12T13:15:52.388463Z"}], "thread_id": "Thread-14", "execution_time": 0.07003092765808105, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.333795Z", "completed_at": "2023-09-12T13:15:52.338454Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.388463Z", "completed_at": "2023-09-12T13:15:52.388463Z"}], "thread_id": "Thread-17", "execution_time": 0.07163023948669434, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_time_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.338454Z", "completed_at": "2023-09-12T13:15:52.368780Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.396311Z", "completed_at": "2023-09-12T13:15:52.396311Z"}], "thread_id": "Thread-16", "execution_time": 0.07636046409606934, "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": "2023-09-12T13:15:52.338454Z", "completed_at": "2023-09-12T13:15:52.387465Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.402932Z", "completed_at": "2023-09-12T13:15:52.402932Z"}], "thread_id": "Thread-19", "execution_time": 0.07596683502197266, "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": "2023-09-12T13:15:52.348428Z", "completed_at": "2023-09-12T13:15:52.388463Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.404032Z", "completed_at": "2023-09-12T13:15:52.404032Z"}], "thread_id": "Thread-18", "execution_time": 0.06731128692626953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.368780Z", "completed_at": "2023-09-12T13:15:52.394712Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.404765Z", "completed_at": "2023-09-12T13:15:52.404765Z"}], "thread_id": "Thread-15", "execution_time": 0.06983447074890137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.389516Z", "completed_at": "2023-09-12T13:15:52.401993Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.408288Z", "completed_at": "2023-09-12T13:15:52.408288Z"}], "thread_id": "Thread-21", "execution_time": 0.06983447074890137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.397321Z", "completed_at": "2023-09-12T13:15:52.405765Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.408288Z", "completed_at": "2023-09-12T13:15:52.408288Z"}], "thread_id": "Thread-20", "execution_time": 0.0372166633605957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.408288Z", "completed_at": "2023-09-12T13:15:52.425322Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.434250Z", "completed_at": "2023-09-12T13:15:52.434250Z"}], "thread_id": "Thread-14", "execution_time": 0.029678821563720703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.408288Z", "completed_at": "2023-09-12T13:15:52.425567Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.434250Z", "completed_at": "2023-09-12T13:15:52.434250Z"}], "thread_id": "Thread-17", "execution_time": 0.029678821563720703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__use_case"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.425567Z", "completed_at": "2023-09-12T13:15:52.434250Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.435444Z", "completed_at": "2023-09-12T13:15:52.435444Z"}], "thread_id": "Thread-16", "execution_time": 0.030882596969604492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.439171Z", "completed_at": "2023-09-12T13:15:52.498442Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.498442Z", "completed_at": "2023-09-12T13:15:52.498442Z"}], "thread_id": "Thread-19", "execution_time": 0.05927157402038574, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__test_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.439171Z", "completed_at": "2023-09-12T13:15:52.498442Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.498442Z", "completed_at": "2023-09-12T13:15:52.498442Z"}], "thread_id": "Thread-15", "execution_time": 0.05927157402038574, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.498442Z", "completed_at": "2023-09-12T13:15:52.508563Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.508563Z", "completed_at": "2023-09-12T13:15:52.508563Z"}], "thread_id": "Thread-20", "execution_time": 0.010120630264282227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.508563Z", "completed_at": "2023-09-12T13:15:52.508563Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.508563Z", "completed_at": "2023-09-12T13:15:52.508563Z"}], "thread_id": "Thread-14", "execution_time": 0.010120630264282227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.520011Z", "completed_at": "2023-09-12T13:15:52.520011Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.520011Z", "completed_at": "2023-09-12T13:15:52.520011Z"}], "thread_id": "Thread-17", "execution_time": 0.0015184879302978516, "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": "2023-09-12T13:15:52.520011Z", "completed_at": "2023-09-12T13:15:52.542667Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.542667Z", "completed_at": "2023-09-12T13:15:52.542667Z"}], "thread_id": "Thread-16", "execution_time": 0.022655248641967773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.542667Z", "completed_at": "2023-09-12T13:15:52.548920Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.548920Z", "completed_at": "2023-09-12T13:15:52.548920Z"}], "thread_id": "Thread-15", "execution_time": 0.006253957748413086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.548920Z", "completed_at": "2023-09-12T13:15:52.598521Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.598521Z", "completed_at": "2023-09-12T13:15:52.598521Z"}], "thread_id": "Thread-20", "execution_time": 0.04960012435913086, "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": "2023-09-12T13:15:52.560668Z", "completed_at": "2023-09-12T13:15:52.598521Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.598521Z", "completed_at": "2023-09-12T13:15:52.598521Z"}], "thread_id": "Thread-14", "execution_time": 0.04960012435913086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.584852Z", "completed_at": "2023-09-12T13:15:52.598521Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.598521Z", "completed_at": "2023-09-12T13:15:52.598521Z"}], "thread_id": "Thread-21", "execution_time": 0.04960012435913086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.608649Z", "completed_at": "2023-09-12T13:15:52.628567Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.639604Z", "completed_at": "2023-09-12T13:15:52.639604Z"}], "thread_id": "Thread-19", "execution_time": 0.041083574295043945, "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": "2023-09-12T13:15:52.608649Z", "completed_at": "2023-09-12T13:15:52.638581Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.639604Z", "completed_at": "2023-09-12T13:15:52.639604Z"}], "thread_id": "Thread-16", "execution_time": 0.041083574295043945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.623505Z", "completed_at": "2023-09-12T13:15:52.639604Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.639604Z", "completed_at": "2023-09-12T13:15:52.639604Z"}], "thread_id": "Thread-18", "execution_time": 0.041083574295043945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.623505Z", "completed_at": "2023-09-12T13:15:52.639604Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.639604Z", "completed_at": "2023-09-12T13:15:52.639604Z"}], "thread_id": "Thread-15", "execution_time": 0.041083574295043945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.628567Z", "completed_at": "2023-09-12T13:15:52.639604Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.639604Z", "completed_at": "2023-09-12T13:15:52.639604Z"}], "thread_id": "Thread-17", "execution_time": 0.03195834159851074, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.648303Z", "completed_at": "2023-09-12T13:15:52.676311Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.696369Z", "completed_at": "2023-09-12T13:15:52.696369Z"}], "thread_id": "Thread-14", "execution_time": 0.059216976165771484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.663779Z", "completed_at": "2023-09-12T13:15:52.678405Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.698538Z", "completed_at": "2023-09-12T13:15:52.698538Z"}], "thread_id": "Thread-21", "execution_time": 0.05255842208862305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.678405Z", "completed_at": "2023-09-12T13:15:52.696924Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.701509Z", "completed_at": "2023-09-12T13:15:52.701509Z"}], "thread_id": "Thread-16", "execution_time": 0.055863380432128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.688364Z", "completed_at": "2023-09-12T13:15:52.696924Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.702469Z", "completed_at": "2023-09-12T13:15:52.702469Z"}], "thread_id": "Thread-20", "execution_time": 0.0410153865814209, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.706567Z", "completed_at": "2023-09-12T13:15:52.725086Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.728911Z", "completed_at": "2023-09-12T13:15:52.728911Z"}], "thread_id": "Thread-15", "execution_time": 0.02644205093383789, "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": "2023-09-12T13:15:52.720826Z", "completed_at": "2023-09-12T13:15:52.728911Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.728911Z", "completed_at": "2023-09-12T13:15:52.728911Z"}], "thread_id": "Thread-17", "execution_time": 0.02572464942932129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.726196Z", "completed_at": "2023-09-12T13:15:52.728911Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.728911Z", "completed_at": "2023-09-12T13:15:52.728911Z"}], "thread_id": "Thread-18", "execution_time": 0.023344039916992188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.748514Z", "completed_at": "2023-09-12T13:15:52.783696Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.789719Z", "completed_at": "2023-09-12T13:15:52.789719Z"}], "thread_id": "Thread-16", "execution_time": 0.05344271659851074, "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": "2023-09-12T13:15:52.758350Z", "completed_at": "2023-09-12T13:15:52.784760Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.789719Z", "completed_at": "2023-09-12T13:15:52.789719Z"}], "thread_id": "Thread-20", "execution_time": 0.054454803466796875, "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": "2023-09-12T13:15:52.758350Z", "completed_at": "2023-09-12T13:15:52.784760Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.791162Z", "completed_at": "2023-09-12T13:15:52.791162Z"}], "thread_id": "Thread-15", "execution_time": 0.055454254150390625, "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": "2023-09-12T13:15:52.768595Z", "completed_at": "2023-09-12T13:15:52.784760Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.791162Z", "completed_at": "2023-09-12T13:15:52.791162Z"}], "thread_id": "Thread-17", "execution_time": 0.055454254150390625, "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": "2023-09-12T13:15:52.827332Z", "completed_at": "2023-09-12T13:15:52.859473Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.891419Z", "completed_at": "2023-09-12T13:15:52.891419Z"}], "thread_id": "Thread-15", "execution_time": 0.11326050758361816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.833788Z", "completed_at": "2023-09-12T13:15:52.859473Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.891419Z", "completed_at": "2023-09-12T13:15:52.891419Z"}], "thread_id": "Thread-17", "execution_time": 0.11385011672973633, "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": "2023-09-12T13:15:52.859473Z", "completed_at": "2023-09-12T13:15:52.918687Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.936386Z", "completed_at": "2023-09-12T13:15:52.936386Z"}], "thread_id": "Thread-19", "execution_time": 0.10429072380065918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.888846Z", "completed_at": "2023-09-12T13:15:52.923673Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.956393Z", "completed_at": "2023-09-12T13:15:52.956393Z"}], "thread_id": "Thread-21", "execution_time": 0.10040783882141113, "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": "2023-09-12T13:15:52.891419Z", "completed_at": "2023-09-12T13:15:52.932284Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.958232Z", "completed_at": "2023-09-12T13:15:52.958232Z"}], "thread_id": "Thread-14", "execution_time": 0.10148739814758301, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.924613Z", "completed_at": "2023-09-12T13:15:52.935679Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:52.960960Z", "completed_at": "2023-09-12T13:15:52.960960Z"}], "thread_id": "Thread-18", "execution_time": 0.10383057594299316, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.936386Z", "completed_at": "2023-09-12T13:15:52.959856Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.029671Z", "completed_at": "2023-09-12T13:15:53.029671Z"}], "thread_id": "Thread-16", "execution_time": 0.11426854133605957, "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": "2023-09-12T13:15:52.948953Z", "completed_at": "2023-09-12T13:15:52.959856Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.030989Z", "completed_at": "2023-09-12T13:15:53.030989Z"}], "thread_id": "Thread-20", "execution_time": 0.11538028717041016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:52.960960Z", "completed_at": "2023-09-12T13:15:53.031960Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.047136Z", "completed_at": "2023-09-12T13:15:53.047136Z"}], "thread_id": "Thread-15", "execution_time": 0.11208033561706543, "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": "2023-09-12T13:15:52.983373Z", "completed_at": "2023-09-12T13:15:53.031960Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.047136Z", "completed_at": "2023-09-12T13:15:53.047136Z"}], "thread_id": "Thread-17", "execution_time": 0.11160159111022949, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.035268Z", "completed_at": "2023-09-12T13:15:53.051869Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.068823Z", "completed_at": "2023-09-12T13:15:53.068823Z"}], "thread_id": "Thread-19", "execution_time": 0.049996137619018555, "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": "2023-09-12T13:15:53.038954Z", "completed_at": "2023-09-12T13:15:53.053345Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.075255Z", "completed_at": "2023-09-12T13:15:53.075255Z"}], "thread_id": "Thread-21", "execution_time": 0.048700809478759766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.048651Z", "completed_at": "2023-09-12T13:15:53.068823Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.078372Z", "completed_at": "2023-09-12T13:15:53.078372Z"}], "thread_id": "Thread-14", "execution_time": 0.04641127586364746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.068823Z", "completed_at": "2023-09-12T13:15:53.078372Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.096928Z", "completed_at": "2023-09-12T13:15:53.096928Z"}], "thread_id": "Thread-16", "execution_time": 0.04561972618103027, "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": "2023-09-12T13:15:53.075255Z", "completed_at": "2023-09-12T13:15:53.078372Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.096928Z", "completed_at": "2023-09-12T13:15:53.096928Z"}], "thread_id": "Thread-20", "execution_time": 0.044829368591308594, "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": "2023-09-12T13:15:53.088672Z", "completed_at": "2023-09-12T13:15:53.098439Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.108534Z", "completed_at": "2023-09-12T13:15:53.108534Z"}], "thread_id": "Thread-15", "execution_time": 0.030162811279296875, "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": "2023-09-12T13:15:53.091925Z", "completed_at": "2023-09-12T13:15:53.098439Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.108534Z", "completed_at": "2023-09-12T13:15:53.108534Z"}], "thread_id": "Thread-17", "execution_time": 0.030162811279296875, "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": "2023-09-12T13:15:53.098439Z", "completed_at": "2023-09-12T13:15:53.108534Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.118730Z", "completed_at": "2023-09-12T13:15:53.118730Z"}], "thread_id": "Thread-19", "execution_time": 0.03653264045715332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.106958Z", "completed_at": "2023-09-12T13:15:53.108534Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.128458Z", "completed_at": "2023-09-12T13:15:53.128458Z"}], "thread_id": "Thread-21", "execution_time": 0.03152942657470703, "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": "2023-09-12T13:15:53.108534Z", "completed_at": "2023-09-12T13:15:53.118730Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.128458Z", "completed_at": "2023-09-12T13:15:53.128458Z"}], "thread_id": "Thread-14", "execution_time": 0.03001880645751953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.118730Z", "completed_at": "2023-09-12T13:15:53.128458Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.138763Z", "completed_at": "2023-09-12T13:15:53.138763Z"}], "thread_id": "Thread-16", "execution_time": 0.030228614807128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month_.ae2161e384"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.122760Z", "completed_at": "2023-09-12T13:15:53.128458Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.138763Z", "completed_at": "2023-09-12T13:15:53.138763Z"}], "thread_id": "Thread-20", "execution_time": 0.030228614807128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__primary_diagnosis_count"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.138763Z", "completed_at": "2023-09-12T13:15:53.138763Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.199741Z", "completed_at": "2023-09-12T13:15:53.199741Z"}], "thread_id": "Thread-17", "execution_time": 0.0745391845703125, "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": "2023-09-12T13:15:53.154705Z", "completed_at": "2023-09-12T13:15:53.202041Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.213333Z", "completed_at": "2023-09-12T13:15:53.213333Z"}], "thread_id": "Thread-21", "execution_time": 0.07648944854736328, "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": "2023-09-12T13:15:53.197025Z", "completed_at": "2023-09-12T13:15:53.204026Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.214250Z", "completed_at": "2023-09-12T13:15:53.214250Z"}], "thread_id": "Thread-14", "execution_time": 0.07748007774353027, "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": "2023-09-12T13:15:53.206984Z", "completed_at": "2023-09-12T13:15:53.215253Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.304785Z", "completed_at": "2023-09-12T13:15:53.304785Z"}], "thread_id": "Thread-16", "execution_time": 0.10577845573425293, "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": "2023-09-12T13:15:53.210250Z", "completed_at": "2023-09-12T13:15:53.216243Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.305782Z", "completed_at": "2023-09-12T13:15:53.305782Z"}], "thread_id": "Thread-20", "execution_time": 0.10677361488342285, "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": "2023-09-12T13:15:53.217240Z", "completed_at": "2023-09-12T13:15:53.306780Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.460777Z", "completed_at": "2023-09-12T13:15:53.460777Z"}], "thread_id": "Thread-17", "execution_time": 0.25020885467529297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.422409Z", "completed_at": "2023-09-12T13:15:53.461790Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.477143Z", "completed_at": "2023-09-12T13:15:53.477143Z"}], "thread_id": "Thread-14", "execution_time": 0.20531535148620605, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.308771Z", "completed_at": "2023-09-12T13:15:53.462957Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.511097Z", "completed_at": "2023-09-12T13:15:53.511097Z"}], "thread_id": "Thread-21", "execution_time": 0.20631194114685059, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.464664Z", "completed_at": "2023-09-12T13:15:53.511097Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.518723Z", "completed_at": "2023-09-12T13:15:53.518723Z"}], "thread_id": "Thread-16", "execution_time": 0.09102463722229004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.477143Z", "completed_at": "2023-09-12T13:15:53.518723Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.550886Z", "completed_at": "2023-09-12T13:15:53.550886Z"}], "thread_id": "Thread-20", "execution_time": 0.0901634693145752, "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": "2023-09-12T13:15:53.518723Z", "completed_at": "2023-09-12T13:15:53.551202Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.591168Z", "completed_at": "2023-09-12T13:15:53.591168Z"}], "thread_id": "Thread-17", "execution_time": 0.08007049560546875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.553183Z", "completed_at": "2023-09-12T13:15:53.591168Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.599100Z", "completed_at": "2023-09-12T13:15:53.599100Z"}], "thread_id": "Thread-14", "execution_time": 0.05796384811401367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.588589Z", "completed_at": "2023-09-12T13:15:53.591168Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.599100Z", "completed_at": "2023-09-12T13:15:53.599100Z"}], "thread_id": "Thread-21", "execution_time": 0.05703330039978027, "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": "2023-09-12T13:15:53.591168Z", "completed_at": "2023-09-12T13:15:53.599100Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.608447Z", "completed_at": "2023-09-12T13:15:53.608447Z"}], "thread_id": "Thread-16", "execution_time": 0.017279863357543945, "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": "2023-09-12T13:15:53.599100Z", "completed_at": "2023-09-12T13:15:53.608447Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.608447Z", "completed_at": "2023-09-12T13:15:53.608447Z"}], "thread_id": "Thread-20", "execution_time": 0.0313417911529541, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.608447Z", "completed_at": "2023-09-12T13:15:53.608447Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.622509Z", "completed_at": "2023-09-12T13:15:53.622509Z"}], "thread_id": "Thread-17", "execution_time": 0.029412031173706055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.618507Z", "completed_at": "2023-09-12T13:15:53.622509Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.628511Z", "completed_at": "2023-09-12T13:15:53.628511Z"}], "thread_id": "Thread-14", "execution_time": 0.020064115524291992, "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": "2023-09-12T13:15:53.622509Z", "completed_at": "2023-09-12T13:15:53.628511Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.628511Z", "completed_at": "2023-09-12T13:15:53.628511Z"}], "thread_id": "Thread-21", "execution_time": 0.029967308044433594, "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": "2023-09-12T13:15:53.628511Z", "completed_at": "2023-09-12T13:15:53.628511Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.638415Z", "completed_at": "2023-09-12T13:15:53.638415Z"}], "thread_id": "Thread-16", "execution_time": 0.015905380249023438, "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": "2023-09-12T13:15:53.628511Z", "completed_at": "2023-09-12T13:15:53.638415Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.638415Z", "completed_at": "2023-09-12T13:15:53.638415Z"}], "thread_id": "Thread-20", "execution_time": 0.025285005569458008, "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": "2023-09-12T13:15:53.638415Z", "completed_at": "2023-09-12T13:15:53.638415Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.653796Z", "completed_at": "2023-09-12T13:15:53.653796Z"}], "thread_id": "Thread-17", "execution_time": 0.030509471893310547, "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": "2023-09-12T13:15:53.638415Z", "completed_at": "2023-09-12T13:15:53.659021Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.670459Z", "completed_at": "2023-09-12T13:15:53.670459Z"}], "thread_id": "Thread-14", "execution_time": 0.03362298011779785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.653796Z", "completed_at": "2023-09-12T13:15:53.668561Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.672038Z", "completed_at": "2023-09-12T13:15:53.672038Z"}], "thread_id": "Thread-21", "execution_time": 0.04031085968017578, "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": "2023-09-12T13:15:53.659021Z", "completed_at": "2023-09-12T13:15:53.671457Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.678725Z", "completed_at": "2023-09-12T13:15:53.678725Z"}], "thread_id": "Thread-16", "execution_time": 0.03491568565368652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.673659Z", "completed_at": "2023-09-12T13:15:53.678725Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.695771Z", "completed_at": "2023-09-12T13:15:53.695771Z"}], "thread_id": "Thread-20", "execution_time": 0.031839609146118164, "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": "2023-09-12T13:15:53.678725Z", "completed_at": "2023-09-12T13:15:53.688712Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.696041Z", "completed_at": "2023-09-12T13:15:53.696041Z"}], "thread_id": "Thread-17", "execution_time": 0.03139305114746094, "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": "2023-09-12T13:15:53.690716Z", "completed_at": "2023-09-12T13:15:53.702239Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.708826Z", "completed_at": "2023-09-12T13:15:53.708826Z"}], "thread_id": "Thread-14", "execution_time": 0.03249716758728027, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.696041Z", "completed_at": "2023-09-12T13:15:53.703362Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.711223Z", "completed_at": "2023-09-12T13:15:53.711223Z"}], "thread_id": "Thread-21", "execution_time": 0.029761791229248047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.704287Z", "completed_at": "2023-09-12T13:15:53.711223Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.724001Z", "completed_at": "2023-09-12T13:15:53.724001Z"}], "thread_id": "Thread-16", "execution_time": 0.02902364730834961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.712491Z", "completed_at": "2023-09-12T13:15:53.725064Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.728566Z", "completed_at": "2023-09-12T13:15:53.728566Z"}], "thread_id": "Thread-20", "execution_time": 0.031905174255371094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.728566Z", "completed_at": "2023-09-12T13:15:53.740731Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.748739Z", "completed_at": "2023-09-12T13:15:53.748739Z"}], "thread_id": "Thread-14", "execution_time": 0.023675203323364258, "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": "2023-09-12T13:15:53.738716Z", "completed_at": "2023-09-12T13:15:53.740731Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.748739Z", "completed_at": "2023-09-12T13:15:53.748739Z"}], "thread_id": "Thread-21", "execution_time": 0.023675203323364258, "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": "2023-09-12T13:15:53.740731Z", "completed_at": "2023-09-12T13:15:53.748739Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.748739Z", "completed_at": "2023-09-12T13:15:53.748739Z"}], "thread_id": "Thread-16", "execution_time": 0.0282900333404541, "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": "2023-09-12T13:15:53.748739Z", "completed_at": "2023-09-12T13:15:53.756856Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.758459Z", "completed_at": "2023-09-12T13:15:53.758459Z"}], "thread_id": "Thread-20", "execution_time": 0.05149722099304199, "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": "2023-09-12T13:15:53.758459Z", "completed_at": "2023-09-12T13:15:53.802889Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.804807Z", "completed_at": "2023-09-12T13:15:53.804807Z"}], "thread_id": "Thread-14", "execution_time": 0.048346519470214844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.799736Z", "completed_at": "2023-09-12T13:15:53.804807Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.807076Z", "completed_at": "2023-09-12T13:15:53.807076Z"}], "thread_id": "Thread-16", "execution_time": 0.05012059211730957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.793224Z", "completed_at": "2023-09-12T13:15:53.805803Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.808078Z", "completed_at": "2023-09-12T13:15:53.808078Z"}], "thread_id": "Thread-21", "execution_time": 0.05012059211730957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.808579Z", "completed_at": "2023-09-12T13:15:53.813707Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.828517Z", "completed_at": "2023-09-12T13:15:53.828517Z"}], "thread_id": "Thread-20", "execution_time": 0.021440505981445312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.818715Z", "completed_at": "2023-09-12T13:15:53.828517Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.828517Z", "completed_at": "2023-09-12T13:15:53.828517Z"}], "thread_id": "Thread-16", "execution_time": 0.014809608459472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.824402Z", "completed_at": "2023-09-12T13:15:53.828517Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.828517Z", "completed_at": "2023-09-12T13:15:53.828517Z"}], "thread_id": "Thread-14", "execution_time": 0.014809608459472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.828517Z", "completed_at": "2023-09-12T13:15:53.828517Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.828517Z", "completed_at": "2023-09-12T13:15:53.828517Z"}], "thread_id": "Thread-21", "execution_time": 0.02509021759033203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.840319Z", "completed_at": "2023-09-12T13:15:53.841000Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.858821Z", "completed_at": "2023-09-12T13:15:53.858821Z"}], "thread_id": "Thread-20", "execution_time": 0.0303037166595459, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.848620Z", "completed_at": "2023-09-12T13:15:53.848620Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.858821Z", "completed_at": "2023-09-12T13:15:53.858821Z"}], "thread_id": "Thread-14", "execution_time": 0.017821311950683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.the_tuva_project.quality_measures__summary_long_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.856095Z", "completed_at": "2023-09-12T13:15:53.858821Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.858821Z", "completed_at": "2023-09-12T13:15:53.858821Z"}], "thread_id": "Thread-21", "execution_time": 0.017821311950683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.848620Z", "completed_at": "2023-09-12T13:15:53.858821Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.858821Z", "completed_at": "2023-09-12T13:15:53.858821Z"}], "thread_id": "Thread-16", "execution_time": 0.017821311950683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.871739Z", "completed_at": "2023-09-12T13:15:53.878974Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.887483Z", "completed_at": "2023-09-12T13:15:53.887483Z"}], "thread_id": "Thread-21", "execution_time": 0.029674291610717773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.868738Z", "completed_at": "2023-09-12T13:15:53.878974Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.888495Z", "completed_at": "2023-09-12T13:15:53.888495Z"}], "thread_id": "Thread-20", "execution_time": 0.029674291610717773, "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": "2023-09-12T13:15:53.871739Z", "completed_at": "2023-09-12T13:15:53.878974Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:53.888495Z", "completed_at": "2023-09-12T13:15:53.888495Z"}], "thread_id": "Thread-14", "execution_time": 0.029674291610717773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.138763Z", "completed_at": "2023-09-12T13:15:55.069007Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.079003Z", "completed_at": "2023-09-12T13:15:55.079003Z"}], "thread_id": "Thread-19", "execution_time": 2.0300073623657227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__wide_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.719938Z", "completed_at": "2023-09-12T13:15:55.069007Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.069007Z", "completed_at": "2023-09-12T13:15:55.069007Z"}], "thread_id": "Thread-17", "execution_time": 1.4585466384887695, "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": "2023-09-12T13:15:53.053610Z", "completed_at": "2023-09-12T13:15:55.069007Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.079003Z", "completed_at": "2023-09-12T13:15:55.079003Z"}], "thread_id": "Thread-18", "execution_time": 2.1342475414276123, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__wide_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:53.128458Z", "completed_at": "2023-09-12T13:15:55.069007Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.079003Z", "completed_at": "2023-09-12T13:15:55.079003Z"}], "thread_id": "Thread-15", "execution_time": 2.0485570430755615, "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": "2023-09-12T13:15:55.181224Z", "completed_at": "2023-09-12T13:15:55.188657Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.200966Z", "completed_at": "2023-09-12T13:15:55.200966Z"}], "thread_id": "Thread-18", "execution_time": 0.024956226348876953, "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": "2023-09-12T13:15:55.188657Z", "completed_at": "2023-09-12T13:15:55.188657Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.200966Z", "completed_at": "2023-09-12T13:15:55.200966Z"}], "thread_id": "Thread-16", "execution_time": 0.024344682693481445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-12T13:15:55.188657Z", "completed_at": "2023-09-12T13:15:55.200966Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.203937Z", "completed_at": "2023-09-12T13:15:55.203937Z"}], "thread_id": "Thread-20", "execution_time": 0.019616365432739258, "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": "2023-09-12T13:15:55.188657Z", "completed_at": "2023-09-12T13:15:55.201971Z"}, {"name": "execute", "started_at": "2023-09-12T13:15:55.204625Z", "completed_at": "2023-09-12T13:15:55.204625Z"}], "thread_id": "Thread-14", "execution_time": 0.017009258270263672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"}], "elapsed_time": 34.004523515701294, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "C:\\Users\\forre\\.dbt", "send_anonymous_usage_stats": true, "quiet": false, "no_print": false, "cache_selected_only": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index bb9efa74e..d2b5ee8c5 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -10,15 +10,14 @@ vars: # otherwise set to false and set the input vars below test_data_override: true - ## Update these vars to use your own data as input, do not comment out # enabled logic has been added to the sources config input_database: tuva input_schema: tuva_claims tuva_last_run: '{{ run_started_at.astimezone(modules.pytz.timezone("UTC")) }}' - - ## The Tuva Project can support claims and clinical data. + + ## The Tuva Project can support claims and clinical data. # By default, all models are disabled. # Use the vars below to enabled or disable sections of The Tuva Project. @@ -35,7 +34,7 @@ vars: # tuva_chronic_conditions_enabled: true # cms_hcc_enabled: true # financial_pmpm_enabled: true - # quality_measures_reporting_enabled: true + # quality_measures_enabled: true # readmissions_enabled: true diff --git a/models/claims_preprocessing/claims_preprocessing_models.yml b/models/claims_preprocessing/claims_preprocessing_models.yml index 0f4b7759d..b93650293 100644 --- a/models/claims_preprocessing/claims_preprocessing_models.yml +++ b/models/claims_preprocessing/claims_preprocessing_models.yml @@ -591,17 +591,6 @@ models: tags: data_profiling materialized: table - - name: claims_date_profiling__member_months_count - config: - schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_data_profiling - {% else %}claims_preprocessing{%- endif -%} - alias: member_months_count - tags: data_profiling - materialized: table - - - #### Service Category diff --git a/models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_counts.sql b/models/quality_measures/final/quality_measures__summary_counts.sql similarity index 69% rename from models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_counts.sql rename to models/quality_measures/final/quality_measures__summary_counts.sql index 64b0494df..3577510c4 100644 --- a/models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_counts.sql +++ b/models/quality_measures/final/quality_measures__summary_counts.sql @@ -1,5 +1,5 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} @@ -14,31 +14,11 @@ with summary_long as ( , denominator_flag , numerator_flag , exclusion_flag - from {{ ref('quality_measures_reporting__summary_long') }} + from {{ ref('quality_measures__summary_long') }} where measure_id is not null ) -, apply_exclusions as ( - - select - measure_id - , measure_name - , measure_version - , performance_period_begin - , performance_period_end - , case - when exclusion_flag = 1 then null - else denominator_flag - end as denominator_flag_adjusted - , case - when exclusion_flag = 1 then null - else numerator_flag - end as numerator_flag_adjusted - from summary_long - -) - , sum_flags as ( select @@ -47,9 +27,10 @@ with summary_long as ( , measure_version , performance_period_begin , performance_period_end - , sum(denominator_flag_adjusted) as denominator_sum - , sum(numerator_flag_adjusted) as numerator_sum - from apply_exclusions + , sum(denominator_flag) as denominator_sum + , sum(numerator_flag) as numerator_sum + , sum(exclusion_flag) as exclusion_sum + from summary_long group by measure_id , measure_name @@ -69,9 +50,10 @@ with summary_long as ( , performance_period_end , denominator_sum , numerator_sum + , exclusion_sum , ( cast(numerator_sum as {{ dbt.type_numeric() }}) / - cast(denominator_sum as {{ dbt.type_numeric() }}) + (cast(denominator_sum as {{ dbt.type_numeric() }}) - cast(exclusion_sum as {{ dbt.type_numeric() }})) )*100 as performance_rate from sum_flags @@ -87,6 +69,7 @@ with summary_long as ( , cast(performance_period_end as date) as performance_period_end , cast(denominator_sum as integer) as denominator_sum , cast(numerator_sum as integer) as numerator_sum + , cast(exclusion_sum as integer) as exclusion_sum , round(cast(performance_rate as {{ dbt.type_numeric() }}),3) as performance_rate from calculate_performance_rate @@ -100,6 +83,7 @@ select , performance_period_end , denominator_sum , numerator_sum + , exclusion_sum , performance_rate , '{{ var('tuva_last_run')}}' as tuva_last_run from add_data_types \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_long.sql b/models/quality_measures/final/quality_measures__summary_long.sql similarity index 87% rename from models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_long.sql rename to models/quality_measures/final/quality_measures__summary_long.sql index da55defb8..9d9ae7c96 100644 --- a/models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_long.sql +++ b/models/quality_measures/final/quality_measures__summary_long.sql @@ -1,12 +1,12 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} /* measures should already be at the full eligibility population grain */ with measures_unioned as ( - select * from {{ ref('quality_measures_reporting__int_nqf2372_long') }} + select * from {{ ref('quality_measures__int_nqf2372_long') }} ) diff --git a/models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_wide.sql b/models/quality_measures/final/quality_measures__summary_wide.sql similarity index 86% rename from models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_wide.sql rename to models/quality_measures/final/quality_measures__summary_wide.sql index dfda905a5..221890f94 100644 --- a/models/quality_measures/quality_measures_reporting/final/quality_measures_reporting__summary_wide.sql +++ b/models/quality_measures/final/quality_measures__summary_wide.sql @@ -1,5 +1,5 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} @@ -15,7 +15,7 @@ with measures_long as ( , numerator_flag , exclusion_flag , measure_id - from {{ ref('quality_measures_reporting__summary_long') }} + from {{ ref('quality_measures__summary_long') }} ) diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_denominator.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_denominator.sql similarity index 54% rename from models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_denominator.sql rename to models/quality_measures/intermediate/quality_measures__int_nqf2372_denominator.sql index 04a1e5f11..849f1530f 100644 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_denominator.sql +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_denominator.sql @@ -1,8 +1,8 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} -{%- set performance_period_end = var('quality_measure_reporting_period_end') -%} +{%- set performance_period_end = var('quality_measures_period_end') -%} {%- set performance_period_begin -%} {{ dbt.dateadd(datepart="month", interval=-27, from_date_or_timestamp="'"~performance_period_end~"'") }} @@ -10,19 +10,19 @@ {%- set measure_id -%} (select id -from {{ ref('quality_measures_reporting__measures') }} +from {{ ref('quality_measures__measures') }} where id = 'NQF2372') {%- endset -%} {%- set measure_name -%} (select name -from {{ ref('quality_measures_reporting__measures') }} +from {{ ref('quality_measures__measures') }} where id = 'NQF2372') {%- endset -%} {%- set measure_version -%} (select version -from {{ ref('quality_measures_reporting__measures') }} +from {{ ref('quality_measures__measures') }} where id = 'NQF2372') {%- endset -%} @@ -30,12 +30,22 @@ with patient as ( select patient_id - , gender + , sex , birth_date , death_date , cast({{ performance_period_begin }} as date) as performance_period_begin , cast('{{ performance_period_end }}'as date) as performance_period_end - from {{ ref('quality_measures_reporting__stg_core__patient') }} + from {{ ref('quality_measures__stg_core__patient') }} + +) + +, encounters as ( + + select + patient_id + , encounter_type + , encounter_start_date + from {{ ref('quality_measures__stg_core__encounter') }} ) @@ -46,7 +56,28 @@ with patient as ( , claim_start_date , claim_end_date , hcpcs_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} + from {{ ref('quality_measures__stg_medical_claim') }} + +) + +, procedures as ( + + select + patient_id + , procedure_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__procedure') }} ) @@ -55,7 +86,7 @@ with patient as ( select code , code_system - from {{ ref('quality_measures_reporting__value_sets') }} + from {{ ref('quality_measures__value_sets') }} where concept_name in ( 'Office Visit' , 'Home Healthcare Services' @@ -72,7 +103,7 @@ with patient as ( select patient_id - , gender + , sex , birth_date , death_date , performance_period_begin @@ -95,16 +126,16 @@ with patient as ( , performance_period_end , 1 as denominator_flag from patient_with_age - where lower(gender) = 'female' + where lower(sex) = 'female' and age between 51 and 74 and death_date is null ) /* - Filter to qualifying visit types + Filter to qualifying visit types by claim procedures */ -, qualifying_visits as ( +, visit_claims as ( select medical_claim.patient_id @@ -113,11 +144,39 @@ with patient as ( , medical_claim.hcpcs_code from medical_claim inner join visit_codes - on medical_claim.hcpcs_code = visit_codes.code + on medical_claim.hcpcs_code = visit_codes.code where visit_codes.code_system = 'hcpcs' ) +/* + Filter encounters to qualifying visit type +*/ +, visit_encounters as ( + + select + patient_id + , encounter_start_date + from encounters + where lower(encounter_type) = 'office visit' + +) + +/* + Filter to qualifying visit types by procedure +*/ +, visit_procedures as ( + + select + procedures.patient_id + , procedures.procedure_date + from procedures + inner join visit_codes + on procedures.code = visit_codes.code + and procedures.code_type = visit_codes.code_system + +) + /* Filter to final eligible population/denominator before exclusions with a qualifying visit during the measurement period @@ -131,10 +190,27 @@ with patient as ( , patient_filtered.performance_period_end , patient_filtered.denominator_flag from patient_filtered - inner join qualifying_visits - on patient_filtered.patient_id = qualifying_visits.patient_id - where qualifying_visits.claim_start_date >= patient_filtered.performance_period_begin - or qualifying_visits.claim_end_date <= patient_filtered.performance_period_end + left join visit_claims + on patient_filtered.patient_id = visit_claims.patient_id + left join visit_procedures + on patient_filtered.patient_id = visit_procedures.patient_id + left join visit_encounters + on patient_filtered.patient_id = visit_encounters.patient_id + where ( + visit_claims.claim_start_date + between patient_filtered.performance_period_begin + and patient_filtered.performance_period_end + or visit_claims.claim_end_date + between patient_filtered.performance_period_begin + and patient_filtered.performance_period_end + or visit_procedures.procedure_date + between patient_filtered.performance_period_begin + and patient_filtered.performance_period_end + or visit_encounters.encounter_start_date + between patient_filtered.performance_period_begin + and patient_filtered.performance_period_end + ) + ) , add_data_types as ( diff --git a/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_advanced_illness.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_advanced_illness.sql new file mode 100644 index 000000000..5be28d150 --- /dev/null +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_advanced_illness.sql @@ -0,0 +1,512 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} +/* + Patients greater than or equal to 66 with at least one claim/encounter for + frailty during the measurement period + + AND either one acute inpatient encounter with a diagnosis of advanced + illness + + OR two outpatient, observation, ED or nonacute inpatient encounters on + different dates of service with an advanced illness diagnosis during + measurement period or the year prior to measurement period +*/ + +with denominator as ( + + select + patient_id + , age + , performance_period_begin + , performance_period_end + from {{ ref('quality_measures__int_nqf2372_denominator') }} + +) + +, exclusion_codes as ( + + select + code + , code_system + , concept_name + from {{ ref('quality_measures__value_sets') }} + where concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + , 'Advanced Illness' + , 'Acute Inpatient' + , 'Encounter Inpatient' + , 'Outpatient' + , 'Observation' + , 'Emergency Department Visit' + , 'Nonacute Inpatient' + ) + +) + +, conditions as ( + + select + patient_id + , claim_id + , recorded_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__condition') }} + +) + +, medical_claim as ( + + select + patient_id + , claim_id + , claim_start_date + , claim_end_date + , hcpcs_code + , place_of_service_code + from {{ ref('quality_measures__stg_medical_claim') }} + +) + +, observations as ( + + select + patient_id + , observation_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__observation') }} + +) + +, procedures as ( + + select + patient_id + , procedure_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__procedure') }} + +) + +, condition_exclusions as ( + + select + conditions.patient_id + , conditions.claim_id + , conditions.recorded_date + , exclusion_codes.concept_name + from conditions + inner join exclusion_codes + on conditions.code = exclusion_codes.code + and conditions.code_type = exclusion_codes.code_system + +) + +, med_claim_exclusions as ( + + select + medical_claim.patient_id + , medical_claim.claim_id + , medical_claim.claim_start_date + , medical_claim.claim_end_date + , medical_claim.hcpcs_code + , exclusion_codes.concept_name + from medical_claim + inner join exclusion_codes + on medical_claim.hcpcs_code = exclusion_codes.code + where exclusion_codes.code_system = 'hcpcs' + +) + +, observation_exclusions as ( + + select + observations.patient_id + , observations.observation_date + , exclusion_codes.concept_name + from observations + inner join exclusion_codes + on observations.code = exclusion_codes.code + and observations.code_type = exclusion_codes.code_system + +) + +, procedure_exclusions as ( + + select + procedures.patient_id + , procedures.procedure_date + , exclusion_codes.concept_name + from procedures + inner join exclusion_codes + on procedures.code = exclusion_codes.code + and procedures.code_type = exclusion_codes.code_system + +) + +/* + Patients greater than or equal to 66 with at least one claim/encounter for + frailty during the measurement period +*/ +, patients_with_frailty as ( + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + from denominator + inner join condition_exclusions + on denominator.patient_id = condition_exclusions.patient_id + where denominator.age >= 66 + and condition_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and condition_exclusions.recorded_date + between denominator.performance_period_begin + and denominator.performance_period_end + + union all + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + from denominator + inner join med_claim_exclusions + on denominator.patient_id = med_claim_exclusions.patient_id + where denominator.age >= 66 + and med_claim_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and ( + med_claim_exclusions.claim_start_date + between denominator.performance_period_begin + and denominator.performance_period_end + or med_claim_exclusions.claim_end_date + between denominator.performance_period_begin + and denominator.performance_period_end + ) + + union all + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + from denominator + inner join observation_exclusions + on denominator.patient_id = observation_exclusions.patient_id + where denominator.age >= 66 + and observation_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and observation_exclusions.observation_date + between denominator.performance_period_begin + and denominator.performance_period_end + + union all + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + from denominator + inner join procedure_exclusions + on denominator.patient_id = procedure_exclusions.patient_id + where denominator.age >= 66 + and procedure_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and procedure_exclusions.procedure_date + between denominator.performance_period_begin + and denominator.performance_period_end + +) + +/* + Patients greater than or equal to 66 with at least one claim/encounter for + frailty during the measurement period + + AND one acute inpatient encounter with a diagnosis of advanced illness + during measurement period or the year prior to measurement period +*/ +, acute_inpatient as ( + + select distinct + patients_with_frailty.patient_id + , coalesce( + med_claim_exclusions.claim_start_date + , med_claim_exclusions.claim_end_date + ) as exclusion_date + , med_claim_exclusions.concept_name + || ' with ' + || condition_exclusions.concept_name + as exclusion_reason + from patients_with_frailty + inner join med_claim_exclusions + on patients_with_frailty.patient_id = med_claim_exclusions.patient_id + inner join condition_exclusions + on med_claim_exclusions.claim_id = condition_exclusions.claim_id + where med_claim_exclusions.concept_name = 'Acute Inpatient' + and condition_exclusions.concept_name = 'Advanced Illness' + and ( + med_claim_exclusions.claim_start_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + or med_claim_exclusions.claim_end_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + ) + + union all + + select distinct + patients_with_frailty.patient_id + , observation_exclusions.observation_date as exclusion_date + , observation_exclusions.concept_name as exclusion_reason + from patients_with_frailty + inner join observation_exclusions + on patients_with_frailty.patient_id = observation_exclusions.patient_id + where observation_exclusions.concept_name = 'Acute Inpatient' + and ( + observation_exclusions.observation_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + ) + + union all + + select distinct + patients_with_frailty.patient_id + , procedure_exclusions.procedure_date as exclusion_date + , procedure_exclusions.concept_name as exclusion_reason + from patients_with_frailty + inner join procedure_exclusions + on patients_with_frailty.patient_id = procedure_exclusions.patient_id + inner join condition_exclusions + on procedure_exclusions.patient_id = condition_exclusions.patient_id + and procedure_exclusions.procedure_date = condition_exclusions.recorded_date + where procedure_exclusions.concept_name = 'Acute Inpatient' + and condition_exclusions.concept_name = 'Advanced Illness' + and ( + procedure_exclusions.procedure_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + ) + +) + +/* + Patients greater than or equal to 66 with at least one claim/encounter for + frailty during the measurement period + + AND two outpatient, observation, ED or nonacute inpatient encounters + on different dates of service with an advanced illness diagnosis during + measurement period or the year prior to measurement period +*/ +, nonacute_outpatient as ( + + select distinct + patients_with_frailty.patient_id + , coalesce( + med_claim_exclusions.claim_start_date + , med_claim_exclusions.claim_end_date + ) as exclusion_date + , med_claim_exclusions.concept_name + || ' with ' + || condition_exclusions.concept_name + as exclusion_reason + from patients_with_frailty + inner join med_claim_exclusions + on patients_with_frailty.patient_id = med_claim_exclusions.patient_id + inner join condition_exclusions + on med_claim_exclusions.claim_id = condition_exclusions.claim_id + where med_claim_exclusions.concept_name in ( + 'Encounter Inpatient' + , 'Outpatient' + , 'Observation' + , 'Emergency Department Visit' + , 'Nonacute Inpatient' + ) + and condition_exclusions.concept_name = 'Advanced Illness' + and ( + med_claim_exclusions.claim_start_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + or med_claim_exclusions.claim_end_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + ) + + union all + + select distinct + patients_with_frailty.patient_id + , observation_exclusions.observation_date as exclusion_date + , observation_exclusions.concept_name as exclusion_reason + from patients_with_frailty + inner join observation_exclusions + on patients_with_frailty.patient_id = observation_exclusions.patient_id + where observation_exclusions.concept_name in ( + 'Encounter Inpatient' + , 'Outpatient' + , 'Observation' + , 'Emergency Department Visit' + , 'Nonacute Inpatient' + ) + and ( + observation_exclusions.observation_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + ) + + union all + + select distinct + patients_with_frailty.patient_id + , procedure_exclusions.procedure_date as exclusion_date + , procedure_exclusions.concept_name as exclusion_reason + from patients_with_frailty + inner join procedure_exclusions + on patients_with_frailty.patient_id = procedure_exclusions.patient_id + inner join condition_exclusions + on procedure_exclusions.patient_id = condition_exclusions.patient_id + and procedure_exclusions.procedure_date = condition_exclusions.recorded_date + where procedure_exclusions.concept_name in ( + 'Encounter Inpatient' + , 'Outpatient' + , 'Observation' + , 'Emergency Department Visit' + , 'Nonacute Inpatient' + ) + and condition_exclusions.concept_name = 'Advanced Illness' + and ( + procedure_exclusions.procedure_date + between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} + and patients_with_frailty.performance_period_end + ) + +) + +/* + Filter to patients who have had one acute inpatient encounter or + two nonacute outpatient encounters +*/ +, acute_inpatient_counts as ( + + select + patient_id + , count(*) as encounter_count + from acute_inpatient + group by patient_id + +) + +, nonacute_outpatient_counts as ( + + select + patient_id + , count(*) as encounter_count + from nonacute_outpatient + group by patient_id + +) + +, eligible_acute_inpatient as ( + + select + acute_inpatient.patient_id + , acute_inpatient.exclusion_date + , acute_inpatient.exclusion_reason + from acute_inpatient + left join acute_inpatient_counts + on acute_inpatient.patient_id = acute_inpatient_counts.patient_id + where acute_inpatient_counts.encounter_count >= 1 + +) + +, eligible_nonacute_outpatient as ( + + select + nonacute_outpatient.patient_id + , nonacute_outpatient.exclusion_date + , nonacute_outpatient.exclusion_reason + from nonacute_outpatient + left join nonacute_outpatient_counts + on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id + where nonacute_outpatient_counts.encounter_count >= 2 + +) + +, exclusions_unioned as ( + + select + eligible_acute_inpatient.patient_id + , eligible_acute_inpatient.exclusion_date + , eligible_acute_inpatient.exclusion_reason + from eligible_acute_inpatient + + union all + + select + eligible_nonacute_outpatient.patient_id + , eligible_nonacute_outpatient.exclusion_date + , eligible_nonacute_outpatient.exclusion_reason + from eligible_nonacute_outpatient + +) + +select + patient_id + , exclusion_date + , exclusion_reason + , '{{ var('tuva_last_run')}}' as tuva_last_run +from exclusions_unioned \ No newline at end of file diff --git a/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_dementia.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_dementia.sql new file mode 100644 index 000000000..0ed1b287b --- /dev/null +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_dementia.sql @@ -0,0 +1,384 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +/* + Patients greater than or equal to 66 with at least one claim/encounter for frailty + during the measurement period AND a dispensed medication for dementia during the measurement period + or year prior to measurement period +*/ + +with denominator as ( + + select + patient_id + , age + , performance_period_begin + , performance_period_end + from {{ ref('quality_measures__int_nqf2372_denominator') }} + +) + +, exclusion_codes as ( + + select + code + , code_system + , concept_name + from {{ ref('quality_measures__value_sets') }} + where concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + , 'Dementia Medications' + ) + +) + +, conditions as ( + + select + patient_id + , recorded_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__condition') }} + +) + +, medical_claim as ( + + select + patient_id + , claim_start_date + , claim_end_date + , hcpcs_code + , place_of_service_code + from {{ ref('quality_measures__stg_medical_claim') }} + +) + +, medications as ( + + select + patient_id + , dispensing_date + , source_code_type + , source_code + , ndc_code + , rxnorm_code + from {{ ref('quality_measures__stg_core__medication') }} + +) + +, observations as ( + + select + patient_id + , observation_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__observation') }} + +) + +, pharmacy_claim as ( + + select + patient_id + , dispensing_date + , ndc_code + , paid_date + from {{ ref('quality_measures__stg_pharmacy_claim') }} + +) + +, procedures as ( + + select + patient_id + , procedure_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__procedure') }} + +) + +, condition_exclusions as ( + + select + conditions.patient_id + , conditions.recorded_date + , exclusion_codes.concept_name + from conditions + inner join exclusion_codes + on conditions.code = exclusion_codes.code + and conditions.code_type = exclusion_codes.code_system + +) + +, med_claim_exclusions as ( + + select + medical_claim.patient_id + , medical_claim.claim_start_date + , medical_claim.claim_end_date + , medical_claim.hcpcs_code + , exclusion_codes.concept_name + from medical_claim + inner join exclusion_codes + on medical_claim.hcpcs_code = exclusion_codes.code + where exclusion_codes.code_system = 'hcpcs' + +) + +, medication_exclusions as ( + + select + medications.patient_id + , medications.dispensing_date + , exclusion_codes.concept_name + from medications + inner join exclusion_codes + on medications.ndc_code = exclusion_codes.code + where exclusion_codes.code_system = 'ndc' + + union all + + select + medications.patient_id + , medications.dispensing_date + , exclusion_codes.concept_name + from medications + inner join exclusion_codes + on medications.rxnorm_code = exclusion_codes.code + where exclusion_codes.code_system = 'rxnorm' + + union all + + select + medications.patient_id + , medications.dispensing_date + , exclusion_codes.concept_name + from medications + inner join exclusion_codes + on medications.source_code = exclusion_codes.code + and medications.source_code_type = exclusion_codes.code_system + +) + +, observation_exclusions as ( + + select + observations.patient_id + , observations.observation_date + , exclusion_codes.concept_name + from observations + inner join exclusion_codes + on observations.code = exclusion_codes.code + and observations.code_type = exclusion_codes.code_system + +) + +, pharmacy_claim_exclusions as ( + + select + pharmacy_claim.patient_id + , pharmacy_claim.dispensing_date + , pharmacy_claim.ndc_code + , pharmacy_claim.paid_date + , exclusion_codes.concept_name + from pharmacy_claim + inner join exclusion_codes + on pharmacy_claim.ndc_code = exclusion_codes.code + where exclusion_codes.code_system = 'ndc' + +) + +, procedure_exclusions as ( + + select + procedures.patient_id + , procedures.procedure_date + , exclusion_codes.concept_name + from procedures + inner join exclusion_codes + on procedures.code = exclusion_codes.code + and procedures.code_type = exclusion_codes.code_system + +) + +, patients_with_frailty as ( + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + , condition_exclusions.recorded_date as exclusion_date + , condition_exclusions.concept_name + from denominator + inner join condition_exclusions + on denominator.patient_id = condition_exclusions.patient_id + where denominator.age >= 66 + and condition_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and condition_exclusions.recorded_date + between denominator.performance_period_begin + and denominator.performance_period_end + + union all + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + , coalesce( + med_claim_exclusions.claim_start_date + , med_claim_exclusions.claim_end_date + ) as exclusion_date + , med_claim_exclusions.concept_name + from denominator + inner join med_claim_exclusions + on denominator.patient_id = med_claim_exclusions.patient_id + where denominator.age >= 66 + and med_claim_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and ( + med_claim_exclusions.claim_start_date + between denominator.performance_period_begin + and denominator.performance_period_end + or med_claim_exclusions.claim_end_date + between denominator.performance_period_begin + and denominator.performance_period_end + ) + + union all + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + , observation_exclusions.observation_date as exclusion_date + , observation_exclusions.concept_name + from denominator + inner join observation_exclusions + on denominator.patient_id = observation_exclusions.patient_id + where denominator.age >= 66 + and observation_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and observation_exclusions.observation_date + between denominator.performance_period_begin + and denominator.performance_period_end + + union all + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + , procedure_exclusions.procedure_date as exclusion_date + , procedure_exclusions.concept_name + from denominator + inner join procedure_exclusions + on denominator.patient_id = procedure_exclusions.patient_id + where denominator.age >= 66 + and procedure_exclusions.concept_name in ( + 'Frailty Device' + , 'Frailty Diagnosis' + , 'Frailty Encounter' + , 'Frailty Symptom' + ) + and procedure_exclusions.procedure_date + between denominator.performance_period_begin + and denominator.performance_period_end + +) + +, frailty_with_dementia as ( + + select + patients_with_frailty.patient_id + , patients_with_frailty.exclusion_date + , patients_with_frailty.concept_name + || ' with ' + || pharmacy_claim_exclusions.concept_name + as exclusion_reason + from patients_with_frailty + inner join pharmacy_claim_exclusions + on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id + where ( + pharmacy_claim_exclusions.dispensing_date + between patients_with_frailty.performance_period_begin + and patients_with_frailty.performance_period_end + or pharmacy_claim_exclusions.paid_date + between patients_with_frailty.performance_period_begin + and patients_with_frailty.performance_period_end + ) + + union all + + select + patients_with_frailty.patient_id + , medication_exclusions.dispensing_date as exclusion_date + , patients_with_frailty.concept_name + || ' with ' + || medication_exclusions.concept_name + as exclusion_reason + from patients_with_frailty + inner join medication_exclusions + on patients_with_frailty.patient_id = medication_exclusions.patient_id + where medication_exclusions.dispensing_date + between patients_with_frailty.performance_period_begin + and patients_with_frailty.performance_period_end + +) + +select + patient_id + , exclusion_date + , exclusion_reason + , '{{ var('tuva_last_run')}}' as tuva_last_run +from frailty_with_dementia \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_hospice.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_hospice.sql similarity index 52% rename from models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_hospice.sql rename to models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_hospice.sql index dc19a4929..b5364c2db 100644 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_hospice.sql +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_hospice.sql @@ -1,5 +1,5 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} @@ -13,7 +13,7 @@ with denominator as ( patient_id , performance_period_begin , performance_period_end - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} + from {{ ref('quality_measures__int_nqf2372_denominator') }} ) @@ -23,7 +23,7 @@ with denominator as ( code , code_system , concept_name - from {{ ref('quality_measures_reporting__value_sets') }} + from {{ ref('quality_measures__value_sets') }} where concept_name in ( 'Hospice Care Ambulatory' , 'Hospice Encounter' @@ -31,6 +31,27 @@ with denominator as ( ) +, observations as ( + + select + patient_id + , observation_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__observation') }} + +) + , medical_claim as ( select @@ -39,7 +60,7 @@ with denominator as ( , claim_end_date , hcpcs_code , place_of_service_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} + from {{ ref('quality_measures__stg_medical_claim') }} ) @@ -48,9 +69,22 @@ with denominator as ( select patient_id , procedure_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__procedure') }} + , normalized_code_type + , normalized_code + from {{ ref('quality_measures__stg_core__procedure') }} + +) + +, observation_exclusions as ( + + select + observations.patient_id + , observations.observation_date + , exclusion_codes.concept_name + from observations + inner join exclusion_codes + on observations.code = exclusion_codes.code + and observations.code_type = exclusion_codes.code_system ) @@ -64,7 +98,7 @@ with denominator as ( , exclusion_codes.concept_name from medical_claim inner join exclusion_codes - on medical_claim.hcpcs_code = exclusion_codes.code + on medical_claim.hcpcs_code = exclusion_codes.code where exclusion_codes.code_system = 'hcpcs' ) @@ -74,28 +108,39 @@ with denominator as ( select procedures.patient_id , procedures.procedure_date - , procedures.code_type - , procedures.code , exclusion_codes.concept_name from procedures inner join exclusion_codes - on procedures.code = exclusion_codes.code - and procedures.code_type = exclusion_codes.code_system + on procedures.normalized_code = exclusion_codes.code + and procedures.normalized_code_type = exclusion_codes.code_system ) -, hospice_claims as ( +, hospice as ( select denominator.patient_id - , coalesce( + , observation_exclusions.observation_date as exclusion_date + , observation_exclusions.concept_name as exclusion_reason + from denominator + inner join observation_exclusions + on denominator.patient_id = observation_exclusions.patient_id + where observation_exclusions.observation_date + between denominator.performance_period_begin + and denominator.performance_period_end + + union all + + select + denominator.patient_id + , coalesce ( med_claim_exclusions.claim_start_date , med_claim_exclusions.claim_end_date ) as exclusion_date , med_claim_exclusions.concept_name as exclusion_reason from denominator inner join med_claim_exclusions - on denominator.patient_id = med_claim_exclusions.patient_id + on denominator.patient_id = med_claim_exclusions.patient_id where ( med_claim_exclusions.claim_start_date between denominator.performance_period_begin @@ -105,9 +150,7 @@ with denominator as ( and denominator.performance_period_end ) -) - -, hospice_procedures as ( + union all select denominator.patient_id @@ -115,33 +158,16 @@ with denominator as ( , procedure_exclusions.concept_name as exclusion_reason from denominator inner join procedure_exclusions - on denominator.patient_id = procedure_exclusions.patient_id + on denominator.patient_id = procedure_exclusions.patient_id where procedure_exclusions.procedure_date between denominator.performance_period_begin and denominator.performance_period_end ) -, exclusions_unioned as ( - - select - patient_id - , exclusion_date - , exclusion_reason - from hospice_claims - - union all - - select - patient_id - , exclusion_date - , exclusion_reason - from hospice_procedures - -) - select patient_id , exclusion_date , exclusion_reason -from exclusions_unioned \ No newline at end of file + , '{{ var('tuva_last_run')}}' as tuva_last_run +from hospice \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_institutional.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_institutional.sql similarity index 83% rename from models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_institutional.sql rename to models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_institutional.sql index 4faecab32..54bba2130 100644 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_institutional.sql +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_institutional.sql @@ -1,5 +1,5 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} @@ -17,7 +17,7 @@ with denominator as ( , age , performance_period_begin , performance_period_end - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} + from {{ ref('quality_measures__int_nqf2372_denominator') }} ) @@ -29,7 +29,7 @@ with denominator as ( , claim_end_date , hcpcs_code , place_of_service_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} + from {{ ref('quality_measures__stg_medical_claim') }} ) @@ -63,4 +63,5 @@ select patient_id , exclusion_date , exclusion_reason + , '{{ var('tuva_last_run')}}' as tuva_last_run from exclusions \ No newline at end of file diff --git a/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_mastectomy.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_mastectomy.sql new file mode 100644 index 000000000..d65395272 --- /dev/null +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_mastectomy.sql @@ -0,0 +1,177 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +/* + Patients that had a mastectomy performed or who have a history of mastectomy +*/ + +with denominator as ( + + select + patient_id + , performance_period_begin + , performance_period_end + from {{ ref('quality_measures__int_nqf2372_denominator') }} + +) + +, exclusion_codes as ( + + select + code + , code_system + , concept_name + from {{ ref('quality_measures__value_sets') }} + where concept_name in ( + 'Bilateral Mastectomy' + , 'History of bilateral mastectomy' + , 'Status Post Left Mastectomy' + , 'Status Post Right Mastectomy' + , 'Unilateral Mastectomy Left' + , 'Unilateral Mastectomy Right' + , 'Unilateral Mastectomy, Unspecified Laterality' + ) + +) + +, conditions as ( + + select + patient_id + , recorded_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__condition') }} + +) + +, observations as ( + + select + patient_id + , observation_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__observation') }} + +) + +, procedures as ( + + select + patient_id + , procedure_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__procedure') }} + +) + +, condition_exclusions as ( + + select + conditions.patient_id + , conditions.recorded_date + , exclusion_codes.concept_name + from conditions + inner join exclusion_codes + on conditions.code = exclusion_codes.code + and conditions.code_type = exclusion_codes.code_system + +) + +, observation_exclusions as ( + + select + observations.patient_id + , observations.observation_date + , exclusion_codes.concept_name + from observations + inner join exclusion_codes + on observations.code = exclusion_codes.code + and observations.code_type = exclusion_codes.code_system + +) + +, procedure_exclusions as ( + + select + procedures.patient_id + , procedures.procedure_date + , exclusion_codes.concept_name + from procedures + inner join exclusion_codes + on procedures.code = exclusion_codes.code + and procedures.code_type = exclusion_codes.code_system + +) + +, mastectomy as ( + + select + denominator.patient_id + , condition_exclusions.recorded_date as exclusion_date + , condition_exclusions.concept_name as exclusion_reason + from denominator + inner join condition_exclusions + on denominator.patient_id = condition_exclusions.patient_id + + union all + + select + denominator.patient_id + , observation_exclusions.observation_date as exclusion_date + , observation_exclusions.concept_name as exclusion_reason + from denominator + inner join observation_exclusions + on denominator.patient_id = observation_exclusions.patient_id + + union all + + select + denominator.patient_id + , procedure_exclusions.procedure_date as exclusion_date + , procedure_exclusions.concept_name as exclusion_reason + from denominator + inner join procedure_exclusions + on denominator.patient_id = procedure_exclusions.patient_id + +) + +select + patient_id + , exclusion_date + , exclusion_reason + , '{{ var('tuva_last_run')}}' as tuva_last_run +from mastectomy \ No newline at end of file diff --git a/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_palliative.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_palliative.sql new file mode 100644 index 000000000..2e58c72f5 --- /dev/null +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclude_palliative.sql @@ -0,0 +1,182 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +/* + Palliative care services used by patient any time during the measurement period +*/ +with denominator as ( + + select + patient_id + , performance_period_begin + , performance_period_end + from {{ ref('quality_measures__int_nqf2372_denominator') }} + +) + +, exclusion_codes as ( + + select + code + , code_system + , concept_name + from {{ ref('quality_measures__value_sets') }} + where concept_name in ( + 'Palliative Care Encounter' + , 'Palliative Care Intervention' + ) + +) + +, medical_claim as ( + + select + patient_id + , claim_start_date + , claim_end_date + , hcpcs_code + , place_of_service_code + from {{ ref('quality_measures__stg_medical_claim') }} + +) + +, observations as ( + + select + patient_id + , observation_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__observation') }} + +) + +, procedures as ( + + select + patient_id + , procedure_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__procedure') }} + +) + +, med_claim_exclusions as ( + + select + medical_claim.patient_id + , medical_claim.claim_start_date + , medical_claim.claim_end_date + , medical_claim.hcpcs_code + , exclusion_codes.concept_name + from medical_claim + inner join exclusion_codes + on medical_claim.hcpcs_code = exclusion_codes.code + where exclusion_codes.code_system = 'hcpcs' + +) + +, observation_exclusions as ( + + select + observations.patient_id + , observations.observation_date + , exclusion_codes.concept_name + from observations + inner join exclusion_codes + on observations.code = exclusion_codes.code + and observations.code_type = exclusion_codes.code_system + +) + +, procedure_exclusions as ( + + select + procedures.patient_id + , procedures.procedure_date + , exclusion_codes.concept_name + from procedures + inner join exclusion_codes + on procedures.code = exclusion_codes.code + and procedures.code_type = exclusion_codes.code_system + +) + +, palliative_care as ( + + select + denominator.patient_id + , coalesce ( + med_claim_exclusions.claim_start_date + , med_claim_exclusions.claim_end_date + ) as exclusion_date + , med_claim_exclusions.concept_name as exclusion_reason + from denominator + inner join med_claim_exclusions + on denominator.patient_id = med_claim_exclusions.patient_id + where ( + med_claim_exclusions.claim_start_date + between denominator.performance_period_begin + and denominator.performance_period_end + or med_claim_exclusions.claim_end_date + between denominator.performance_period_begin + and denominator.performance_period_end + ) + + union all + + select + denominator.patient_id + , observation_exclusions.observation_date as exclusion_date + , observation_exclusions.concept_name as exclusion_reason + from denominator + inner join observation_exclusions + on denominator.patient_id = observation_exclusions.patient_id + where observation_exclusions.observation_date + between denominator.performance_period_begin + and denominator.performance_period_end + + union all + + select + denominator.patient_id + , procedure_exclusions.procedure_date as exclusion_date + , procedure_exclusions.concept_name as exclusion_reason + from denominator + inner join procedure_exclusions + on denominator.patient_id = procedure_exclusions.patient_id + where procedure_exclusions.procedure_date + between denominator.performance_period_begin + and denominator.performance_period_end + +) + +select + patient_id + , exclusion_date + , exclusion_reason + , '{{ var('tuva_last_run')}}' as tuva_last_run +from palliative_care \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclusions.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclusions.sql similarity index 84% rename from models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclusions.sql rename to models/quality_measures/intermediate/quality_measures__int_nqf2372_exclusions.sql index 6ed3cc0aa..394e49be6 100644 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclusions.sql +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_exclusions.sql @@ -1,5 +1,5 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} @@ -15,7 +15,7 @@ with denominator as ( , measure_id , measure_name , measure_version - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} + from {{ ref('quality_measures__int_nqf2372_denominator') }} ) @@ -25,7 +25,7 @@ with denominator as ( patient_id , exclusion_date , exclusion_reason - from {{ ref('quality_measures_reporting__int_nqf2372_exclude_advanced_illness') }} + from {{ ref('quality_measures__int_nqf2372_exclude_advanced_illness') }} ) @@ -35,7 +35,7 @@ with denominator as ( patient_id , exclusion_date , exclusion_reason - from {{ ref('quality_measures_reporting__int_nqf2372_exclude_dementia') }} + from {{ ref('quality_measures__int_nqf2372_exclude_dementia') }} ) @@ -45,7 +45,7 @@ with denominator as ( patient_id , exclusion_date , exclusion_reason - from {{ ref('quality_measures_reporting__int_nqf2372_exclude_hospice') }} + from {{ ref('quality_measures__int_nqf2372_exclude_hospice') }} ) @@ -55,7 +55,7 @@ with denominator as ( patient_id , exclusion_date , exclusion_reason - from {{ ref('quality_measures_reporting__int_nqf2372_exclude_institutional') }} + from {{ ref('quality_measures__int_nqf2372_exclude_institutional') }} ) @@ -65,7 +65,7 @@ with denominator as ( patient_id , exclusion_date , exclusion_reason - from {{ ref('quality_measures_reporting__int_nqf2372_exclude_mastectomy') }} + from {{ ref('quality_measures__int_nqf2372_exclude_mastectomy') }} ) @@ -75,7 +75,7 @@ with denominator as ( patient_id , exclusion_date , exclusion_reason - from {{ ref('quality_measures_reporting__int_nqf2372_exclude_palliative') }} + from {{ ref('quality_measures__int_nqf2372_exclude_palliative') }} ) @@ -96,7 +96,7 @@ with denominator as ( , advanced_illness.exclusion_reason from denominator left join advanced_illness - on denominator.patient_id = advanced_illness.patient_id + on denominator.patient_id = advanced_illness.patient_id ) @@ -117,7 +117,7 @@ with denominator as ( , dementia.exclusion_reason from denominator left join dementia - on denominator.patient_id = dementia.patient_id + on denominator.patient_id = dementia.patient_id ) @@ -138,7 +138,7 @@ with denominator as ( , hospice.exclusion_reason from denominator left join hospice - on denominator.patient_id = hospice.patient_id + on denominator.patient_id = hospice.patient_id ) @@ -159,7 +159,7 @@ with denominator as ( , institutional.exclusion_reason from denominator left join institutional - on denominator.patient_id = institutional.patient_id + on denominator.patient_id = institutional.patient_id ) @@ -180,7 +180,7 @@ with denominator as ( , mastectomy.exclusion_reason from denominator left join mastectomy - on denominator.patient_id = mastectomy.patient_id + on denominator.patient_id = mastectomy.patient_id ) @@ -201,7 +201,7 @@ with denominator as ( , palliative.exclusion_reason from denominator left join palliative - on denominator.patient_id = palliative.patient_id + on denominator.patient_id = palliative.patient_id ) diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_long.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_long.sql similarity index 91% rename from models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_long.sql rename to models/quality_measures/intermediate/quality_measures__int_nqf2372_long.sql index 2f7a07678..dd91ecfad 100644 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_long.sql +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_long.sql @@ -1,5 +1,5 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} @@ -7,7 +7,7 @@ with patient as ( select distinct patient_id - from {{ ref('quality_measures_reporting__stg_core__patient') }} + from {{ ref('quality_measures__stg_core__patient') }} ) @@ -21,7 +21,7 @@ with patient as ( , measure_name , measure_version , denominator_flag - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} + from {{ ref('quality_measures__int_nqf2372_denominator') }} ) @@ -36,7 +36,7 @@ with patient as ( , measure_version , evidence_date , numerator_flag - from {{ ref('quality_measures_reporting__int_nqf2372_numerator') }} + from {{ ref('quality_measures__int_nqf2372_numerator') }} ) @@ -52,7 +52,7 @@ with patient as ( , exclusion_date , exclusion_reason , exclusion_flag - from {{ ref('quality_measures_reporting__int_nqf2372_exclusions') }} + from {{ ref('quality_measures__int_nqf2372_exclusions') }} ) diff --git a/models/quality_measures/intermediate/quality_measures__int_nqf2372_numerator.sql b/models/quality_measures/intermediate/quality_measures__int_nqf2372_numerator.sql new file mode 100644 index 000000000..b2ceb44fd --- /dev/null +++ b/models/quality_measures/intermediate/quality_measures__int_nqf2372_numerator.sql @@ -0,0 +1,209 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +/* + Eligible population from the denominator model before exclusions +*/ +with denominator as ( + + select + patient_id + , performance_period_begin + , performance_period_end + , measure_id + , measure_name + , measure_version + from {{ ref('quality_measures__int_nqf2372_denominator') }} + +) + +, mammography_codes as ( + + select + code + , code_system + from {{ ref('quality_measures__value_sets') }} + where concept_name = 'Mammography' + +) + +, medical_claim as ( + + select + patient_id + , claim_start_date + , claim_end_date + , hcpcs_code + from {{ ref('quality_measures__stg_medical_claim') }} + +) + +, observations as ( + + select + patient_id + , observation_date + , coalesce ( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce ( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__observation') }} + +) + +, procedures as ( + + select + patient_id + , procedure_date + , coalesce( + normalized_code_type + , case + when lower(source_code_type) = 'cpt' then 'hcpcs' + when lower(source_code_type) = 'snomed' then 'snomed-ct' + else lower(source_code_type) + end + ) as code_type + , coalesce( + normalized_code + , source_code + ) as code + from {{ ref('quality_measures__stg_core__procedure') }} + +) + +, qualifying_claims as ( + + select + medical_claim.patient_id + , medical_claim.claim_start_date + , medical_claim.claim_end_date + from medical_claim + inner join mammography_codes + on medical_claim.hcpcs_code = mammography_codes.code + where mammography_codes.code_system = 'hcpcs' + +) + +, qualifying_observations as ( + + select + observations.patient_id + , observations.observation_date + from observations + inner join mammography_codes + on observations.code = mammography_codes.code + and observations.code_type = mammography_codes.code_system +) + +, qualifying_procedures as ( + + select + procedures.patient_id + , procedures.procedure_date + from procedures + inner join mammography_codes + on procedures.code = mammography_codes.code + and procedures.code_type = mammography_codes.code_system + +) + +/* + Check if patients in the eligible population have had a screening, + diagnostic, film, digital or digital breast tomosynthesis (3D) + mammography results documented and reviewed. +*/ + +, patients_with_mammograms as ( + + select + denominator.patient_id + , denominator.performance_period_begin + , denominator.performance_period_end + , denominator.measure_id + , denominator.measure_name + , denominator.measure_version + , case + when qualifying_claims.claim_start_date + between denominator.performance_period_begin + and denominator.performance_period_end + then qualifying_claims.claim_start_date + when qualifying_claims.claim_end_date + between denominator.performance_period_begin + and denominator.performance_period_end + then qualifying_claims.claim_end_date + when qualifying_observations.observation_date + between denominator.performance_period_begin + and denominator.performance_period_end + then qualifying_observations.observation_date + when qualifying_procedures.procedure_date + between denominator.performance_period_begin + and denominator.performance_period_end + then qualifying_procedures.procedure_date + else null + end as evidence_date + , case + when qualifying_claims.claim_start_date + between denominator.performance_period_begin + and denominator.performance_period_end + then 1 + when qualifying_claims.claim_end_date + between denominator.performance_period_begin + and denominator.performance_period_end + then 1 + when qualifying_observations.observation_date + between denominator.performance_period_begin + and denominator.performance_period_end + then 1 + when qualifying_procedures.procedure_date + between denominator.performance_period_begin + and denominator.performance_period_end + then 1 + else 0 + end as numerator_flag + from denominator + left join qualifying_claims + on denominator.patient_id = qualifying_claims.patient_id + left join qualifying_observations + on denominator.patient_id = qualifying_observations.patient_id + left join qualifying_procedures + on denominator.patient_id = qualifying_procedures.patient_id + +) + +, add_data_types as ( + + select distinct + cast(patient_id as {{ dbt.type_string() }}) as patient_id + , cast(performance_period_begin as date) as performance_period_begin + , cast(performance_period_end as date) as performance_period_end + , cast(measure_id as {{ dbt.type_string() }}) as measure_id + , cast(measure_name as {{ dbt.type_string() }}) as measure_name + , cast(measure_version as {{ dbt.type_string() }}) as measure_version + , cast(evidence_date as date) as evidence_date + , cast(numerator_flag as integer) as numerator_flag + from patients_with_mammograms + +) + +select + patient_id + , performance_period_begin + , performance_period_end + , measure_id + , measure_name + , measure_version + , evidence_date + , numerator_flag + , '{{ var('tuva_last_run')}}' as tuva_last_run +from add_data_types \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/quality_measures_reporting_models.yml b/models/quality_measures/quality_measures_models.yml similarity index 73% rename from models/quality_measures/quality_measures_reporting/quality_measures_reporting_models.yml rename to models/quality_measures/quality_measures_models.yml index bc3425684..512895c96 100644 --- a/models/quality_measures/quality_measures_reporting/quality_measures_reporting_models.yml +++ b/models/quality_measures/quality_measures_models.yml @@ -2,12 +2,12 @@ version: 2 models: ## Final - - name: quality_measures_reporting__summary_counts + - name: quality_measures__summary_counts config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: summary_counts - tags: quality_measures_reporting + tags: quality_measures materialized: table description: Reporting measure counts with performance rates. columns: @@ -23,28 +23,31 @@ models: description: Ending date of the performance or measurement period. - name: denominator_sum description: > - The denominator sum after exclusion logic applied. The denominator is associated with a given patient population that may be counted as eligible to meet a measure’s inclusion requirements. - name: numerator_sum description: > - The numerator sum after exclusion logic applied. 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. + - 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. - name: performance_rate description: > Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. - - name: quality_measures_reporting__summary_long + - name: quality_measures__summary_long config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: summary_long - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Long view of the results for the reporting version of all measures. @@ -87,15 +90,15 @@ models: description: Name of the measure. - name: measure_version description: Version of the measure. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. - - name: quality_measures_reporting__summary_wide + - name: quality_measures__summary_wide config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: summary_wide - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Wide view of the results for the reporting version of all measures. @@ -110,16 +113,16 @@ models: Each measure has a boolean flag which is the result of evaluating the denominator, numerator, and exclusion indicators for the patient. A null indicates that the measure was not applicable for the patient. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. ## Intermediate - - name: quality_measures_reporting__int_nqf2372_denominator + - name: quality_measures__int_nqf2372_denominator config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_denominator - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Denominator logic for the reporting version of NQF 2372, Breast Cancer @@ -143,15 +146,15 @@ models: description: > The denominator is associated with a given patient population that may be counted as eligible to meet a measure’s inclusion requirements. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. - - name: quality_measures_reporting__int_nqf2372_exclude_advanced_illness + - name: quality_measures__int_nqf2372_exclude_advanced_illness config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclude_advanced_illness - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Exclusion logic for patients with frailty and advanced illness for @@ -167,12 +170,12 @@ models: Reason (usually the value set concept name) that excludes patient from the measure. - - name: quality_measures_reporting__int_nqf2372_exclude_dementia + - name: quality_measures__int_nqf2372_exclude_dementia config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclude_dementia - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Exclusion logic for patients with frailty and taking dementia medications @@ -188,12 +191,12 @@ models: Reason (usually the value set concept name) that excludes patient from the measure. - - name: quality_measures_reporting__int_nqf2372_exclude_hospice + - name: quality_measures__int_nqf2372_exclude_hospice config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclude_hospice - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Exclusion logic for patients using hospice services for the reporting @@ -209,12 +212,12 @@ models: Reason (usually the value set concept name) that excludes patient from the measure. - - name: quality_measures_reporting__int_nqf2372_exclude_institutional + - name: quality_measures__int_nqf2372_exclude_institutional config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclude_institutional - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Exclusion logic for patients staying in an institution for the reporting @@ -230,12 +233,12 @@ models: Reason (usually the value set concept name) that excludes patient from the measure. - - name: quality_measures_reporting__int_nqf2372_exclude_mastectomy + - name: quality_measures__int_nqf2372_exclude_mastectomy config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclude_mastectomy - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Exclusion logic for patients with a mastectomy for the reporting @@ -251,12 +254,12 @@ models: Reason (usually the value set concept name) that excludes patient from the measure. - - name: quality_measures_reporting__int_nqf2372_exclude_palliative + - name: quality_measures__int_nqf2372_exclude_palliative config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclude_palliative - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Exclusion logic for patients using palliative services for the reporting @@ -272,12 +275,12 @@ models: Reason (usually the value set concept name) that excludes patient from the measure. - - name: quality_measures_reporting__int_nqf2372_exclusions + - name: quality_measures__int_nqf2372_exclusions config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_exclusions - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer @@ -307,15 +310,15 @@ models: 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. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. - - name: quality_measures_reporting__int_nqf2372_long + - name: quality_measures__int_nqf2372_long config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_long - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Final preparation of the reporting version of NQF 2372, Breast Cancer @@ -357,15 +360,15 @@ models: description: Name of the measure. - name: measure_version description: Version of the measure. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. - - name: quality_measures_reporting__int_nqf2372_numerator + - name: quality_measures__int_nqf2372_numerator config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _int_nqf2372_numerator - tags: quality_measures_reporting + tags: quality_measures materialized: table description: > Numerator logic for the reporting version of NQF 2372, Breast Cancer @@ -391,49 +394,103 @@ models: 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. - - name: last_update + - name: tuva_last_run description: The date and timestamp of the dbt run. ## Staging - - name: quality_measures_reporting__stg_core__condition + - name: quality_measures__stg_core__condition config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _stg_condition - tags: quality_measures_reporting + tags: quality_measures materialized: ephemeral description: Staging conditions from core. columns: - name: patient_id - description: Unique patient_id for each person. tests: - not_null: severity: warn - - name: condition_date - description: Date in which the condition occured. - - name: code_type - description: The type of condition code. - - name: code - description: The condition code. - - name: last_update - description: The date and timestamp of the dbt run. + - name: recorded_date + - name: source_code_type + - name: source_code + - name: normalized_code_type + - name: normalized_code + - name: tuva_last_run + + - name: quality_measures__stg_core__encounter + config: + schema: | + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} + alias: _stg_encounter + tags: quality_measures + materialized: ephemeral + description: > + Staging encounters from core. Creates an empty table if using claims only. + columns: + - name: patient_id + tests: + - not_null: + severity: warn + - name: encounter_type + - name: encounter_start_date + - name: encounter_end_date + - name: tuva_last_run + + - name: quality_measures__stg_core__medication + config: + schema: | + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} + alias: _stg_medication + tags: quality_measures + materialized: ephemeral + description: > + Staging medications from core. Creates an empty table if using claims only. + columns: + - name: patient_id + tests: + - not_null: + severity: warn + - name: dispensing_date + - name: ndc_code + - name: rxnorm_code + - name: tuva_last_run + + - name: quality_measures__stg_core__observation + config: + schema: | + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} + alias: _stg_observation + tags: quality_measures + materialized: ephemeral + description: > + Staging medications from core. Creates an empty table if using claims only. + columns: + - name: patient_id + tests: + - not_null: + severity: warn + - name: observation_date + - name: source_code_type + - name: source_code + - name: normalized_code_type + - name: normalized_code + - name: tuva_last_run - - name: quality_measures_reporting__stg_core__patient + - name: quality_measures__stg_core__patient config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _stg_patient - tags: quality_measures_reporting + tags: quality_measures materialized: ephemeral description: Staging eligibility from the input layer. columns: - name: patient_id - description: Unique patient_id for each person. tests: - not_null: severity: warn - - name: gender - description: Biological sex of the patient. + - name: sex tests: - not_null: severity: warn @@ -441,77 +498,63 @@ models: values: ['female', 'male'] severity: warn - name: birth_date - description: Date the patient was born. tests: - not_null: severity: warn - name: death_date - description: The death date of the patient if there is one. - - name: last_update - description: The date and timestamp of the dbt run. + - name: tuva_last_run - - name: quality_measures_reporting__stg_core__procedure + - name: quality_measures__stg_core__procedure config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _stg_procedure - tags: quality_measures_reporting + tags: quality_measures materialized: ephemeral description: Staging procedures from core. columns: - name: patient_id - description: Unique patient_id for each person. tests: - not_null: severity: warn - name: procedure_date - description: Date when the procedure was performed. - - name: code_type - description: The type of condition code. - - name: code - description: The condition code. - - name: last_update - description: The date and timestamp of the dbt run. + - name: source_code_type + - name: source_code + - name: normalized_code_type + - name: normalized_code + - name: tuva_last_run - - name: quality_measures_reporting__stg_medical_claim + - name: quality_measures__stg_medical_claim config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _stg_medical_claim - tags: quality_measures_reporting + tags: quality_measures materialized: ephemeral - description: Staging medical claims from the input layer. + description: > + Staging medical claims from the input layer. Creates an empty table if + using claims only. columns: - name: patient_id - description: Unique patient_id for each person. - name: claim_start_date - description: Start date for the claim. - name: claim_end_date - description: End date for the claim. - name: place_of_service - description: Place of service for the claim (professional claims only). - name: hcpcs_code - description: HCPCS level 1 or level 2 code for the claim line. - - name: last_update - description: The date and timestamp of the dbt run. + - name: tuva_last_run - - - name: quality_measures_reporting__stg_pharmacy_claim + - name: quality_measures__stg_pharmacy_claim config: schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} alias: _stg_pharmacy_claim - tags: quality_measures_reporting + tags: quality_measures materialized: ephemeral - description: Staging pharmacy claims from the input layer. + description: > + Staging pharmacy claims from the input layer. Creates an empty table if + using claims only. columns: - name: patient_id - description: Unique patient_id for each person. - name: dispensing_date - description: Date the prescription was filled. - name: ndc_code - description: National drug code on the claim. - name: paid_date - description: Date the claim was paid. - - name: last_update - description: The date and timestamp of the dbt run. \ No newline at end of file + - name: tuva_last_run diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql b/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql deleted file mode 100644 index 2e3e780d5..000000000 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_advanced_illness.sql +++ /dev/null @@ -1,358 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} -/* - Patients greater than or equal to 66 with at least one claim/encounter for - frailty during the measurement period - - AND either one acute inpatient encounter with a diagnosis of advanced - illness - - OR two outpatient, observation, ED or nonacute inpatient encounters on - different dates of service with an advanced illness diagnosis during - measurement period or the year prior to measurement period -*/ - -with denominator as ( - - select - patient_id - , age - , performance_period_begin - , performance_period_end - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} - -) - -, exclusion_codes as ( - - select - code - , code_system - , concept_name - from {{ ref('quality_measures_reporting__value_sets') }} - where concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - , 'Advanced Illness' - , 'Acute Inpatient' - , 'Encounter Inpatient' - , 'Outpatient' - , 'Observation' - , 'Emergency Department Visit' - , 'Nonacute Inpatient' - ) - -) - -, conditions as ( - - select - patient_id - , claim_id - , condition_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__condition') }} - -) - -, medical_claim as ( - - select - patient_id - , claim_id - , claim_start_date - , claim_end_date - , hcpcs_code - , place_of_service_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} - -) - -, procedures as ( - - select - patient_id - , procedure_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__procedure') }} - -) - -, condition_exclusions as ( - - select - conditions.patient_id - , conditions.claim_id - , conditions.condition_date - , conditions.code_type - , conditions.code - , exclusion_codes.concept_name - from conditions - inner join exclusion_codes - on conditions.code = exclusion_codes.code - and conditions.code_type = exclusion_codes.code_system - -) - -, med_claim_exclusions as ( - - select - medical_claim.patient_id - , medical_claim.claim_id - , medical_claim.claim_start_date - , medical_claim.claim_end_date - , medical_claim.hcpcs_code - , exclusion_codes.concept_name - from medical_claim - inner join exclusion_codes - on medical_claim.hcpcs_code = exclusion_codes.code - where exclusion_codes.code_system = 'hcpcs' - -) - -, procedure_exclusions as ( - - select - procedures.patient_id - , procedures.procedure_date - , procedures.code_type - , procedures.code - , exclusion_codes.concept_name - from procedures - inner join exclusion_codes - on procedures.code = exclusion_codes.code - and procedures.code_type = exclusion_codes.code_system - -) - -/* - Patients greater than or equal to 66 with at least one claim/encounter for - frailty during the measurement period -*/ -, patients_with_frailty as ( - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - from denominator - inner join med_claim_exclusions - on denominator.patient_id = med_claim_exclusions.patient_id - where denominator.age >= 66 - and med_claim_exclusions.concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - ) - and ( - med_claim_exclusions.claim_start_date - between denominator.performance_period_begin - and denominator.performance_period_end - or med_claim_exclusions.claim_end_date - between denominator.performance_period_begin - and denominator.performance_period_end - ) - - union all - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - from denominator - inner join condition_exclusions - on denominator.patient_id = condition_exclusions.patient_id - where denominator.age >= 66 - and condition_exclusions.concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - ) - and condition_exclusions.condition_date - between denominator.performance_period_begin - and denominator.performance_period_end - - union all - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - from denominator - inner join procedure_exclusions - on denominator.patient_id = procedure_exclusions.patient_id - where denominator.age >= 66 - and procedure_exclusions.concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - ) - and procedure_exclusions.procedure_date - between denominator.performance_period_begin - and denominator.performance_period_end - -) - -/* - Patients greater than or equal to 66 with at least one claim/encounter for - frailty during the measurement period - - AND one acute inpatient encounter with a diagnosis of advanced illness - during measurement period or the year prior to measurement period -*/ -, acute_inpatient as ( - - select distinct - patients_with_frailty.patient_id - , coalesce( - med_claim_exclusions.claim_start_date - , med_claim_exclusions.claim_end_date - ) as exclusion_date - , med_claim_exclusions.concept_name - || ' with ' - || condition_exclusions.concept_name - as exclusion_reason - from patients_with_frailty - inner join med_claim_exclusions - on patients_with_frailty.patient_id = med_claim_exclusions.patient_id - inner join condition_exclusions - on med_claim_exclusions.claim_id = condition_exclusions.claim_id - where med_claim_exclusions.concept_name = 'Acute Inpatient' - and condition_exclusions.concept_name = 'Advanced Illness' - and ( - med_claim_exclusions.claim_start_date - between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} - and patients_with_frailty.performance_period_end - or med_claim_exclusions.claim_end_date - between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} - and patients_with_frailty.performance_period_end - ) - -) - -/* - Patients greater than or equal to 66 with at least one claim/encounter for - frailty during the measurement period - - AND two outpatient, observation, ED or nonacute inpatient encounters - on different dates of service with an advanced illness diagnosis during - measurement period or the year prior to measurement period -*/ -, nonacute_outpatient as ( - - select distinct - patients_with_frailty.patient_id - , coalesce( - med_claim_exclusions.claim_start_date - , med_claim_exclusions.claim_end_date - ) as exclusion_date - , med_claim_exclusions.concept_name - || ' with ' - || condition_exclusions.concept_name - as exclusion_reason - from patients_with_frailty - inner join med_claim_exclusions - on patients_with_frailty.patient_id = med_claim_exclusions.patient_id - inner join condition_exclusions - on med_claim_exclusions.claim_id = condition_exclusions.claim_id - where med_claim_exclusions.concept_name in ( - 'Encounter Inpatient' - , 'Outpatient' - , 'Observation' - , 'Emergency Department Visit' - , 'Nonacute Inpatient' - ) - and condition_exclusions.concept_name = 'Advanced Illness' - and ( - med_claim_exclusions.claim_start_date - between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} - and patients_with_frailty.performance_period_end - or med_claim_exclusions.claim_end_date - between {{ dbt.dateadd(datepart="year", interval=-1, from_date_or_timestamp="patients_with_frailty.performance_period_begin") }} - and patients_with_frailty.performance_period_end - ) - -) - -/* - Filter to patients who have had one acute inpatient encounter or - two nonacute outpatient encounters -*/ -, acute_inpatient_counts as ( - - select - patient_id - , count(*) as encounter_count - from acute_inpatient - group by patient_id - -) - -, nonacute_outpatient_counts as ( - - select - patient_id - , count(*) as encounter_count - from nonacute_outpatient - group by patient_id - -) - -, eligible_acute_inpatient as ( - - select - acute_inpatient.patient_id - , acute_inpatient.exclusion_date - , acute_inpatient.exclusion_reason - from acute_inpatient - left join acute_inpatient_counts - on acute_inpatient.patient_id = acute_inpatient_counts.patient_id - where acute_inpatient_counts.encounter_count >= 1 - -) - -, eligible_nonacute_outpatient as ( - - select - nonacute_outpatient.patient_id - , nonacute_outpatient.exclusion_date - , nonacute_outpatient.exclusion_reason - from nonacute_outpatient - left join nonacute_outpatient_counts - on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id - where nonacute_outpatient_counts.encounter_count >= 2 - -) - -, exclusions_unioned as ( - - select - eligible_acute_inpatient.patient_id - , eligible_acute_inpatient.exclusion_date - , eligible_acute_inpatient.exclusion_reason - from eligible_acute_inpatient - - union all - - select - eligible_nonacute_outpatient.patient_id - , eligible_nonacute_outpatient.exclusion_date - , eligible_nonacute_outpatient.exclusion_reason - from eligible_nonacute_outpatient - -) - -select - patient_id - , exclusion_date - , exclusion_reason -from exclusions_unioned \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_dementia.sql b/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_dementia.sql deleted file mode 100644 index df89ee1c9..000000000 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_dementia.sql +++ /dev/null @@ -1,248 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} - -/* - Patients greater than or equal to 66 with at least one claim/encounter for frailty - during the measurement period AND a dispensed medication for dementia during the measurement period - or year prior to measurement period -*/ - -with denominator as ( - - select - patient_id - , age - , performance_period_begin - , performance_period_end - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} - -) - -, exclusion_codes as ( - - select - code - , code_system - , concept_name - from {{ ref('quality_measures_reporting__value_sets') }} - where concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - , 'Dementia Medications' - ) - -) - -, conditions as ( - - select - patient_id - , condition_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__condition') }} - -) - -, medical_claim as ( - - select - patient_id - , claim_start_date - , claim_end_date - , hcpcs_code - , place_of_service_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} - -) - -, pharmacy_claim as ( - - select - patient_id - , dispensing_date - , ndc_code - , paid_date - from {{ ref('quality_measures_reporting__stg_pharmacy_claim') }} - -) - -, procedures as ( - - select - patient_id - , procedure_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__procedure') }} - -) - -, med_claim_exclusions as ( - - select - medical_claim.patient_id - , medical_claim.claim_start_date - , medical_claim.claim_end_date - , medical_claim.hcpcs_code - , exclusion_codes.concept_name - from medical_claim - inner join exclusion_codes - on medical_claim.hcpcs_code = exclusion_codes.code - where exclusion_codes.code_system = 'hcpcs' - -) - -, pharmacy_claim_exclusions as ( - - select - pharmacy_claim.patient_id - , pharmacy_claim.dispensing_date - , pharmacy_claim.ndc_code - , pharmacy_claim.paid_date - , exclusion_codes.concept_name - from pharmacy_claim - inner join exclusion_codes - on pharmacy_claim.ndc_code = exclusion_codes.code - where exclusion_codes.code_system = 'ndc' - -) - -, condition_exclusions as ( - - select - conditions.patient_id - , conditions.condition_date - , conditions.code_type - , conditions.code - , exclusion_codes.concept_name - from conditions - inner join exclusion_codes - on conditions.code = exclusion_codes.code - and conditions.code_type = exclusion_codes.code_system - -) - -, procedure_exclusions as ( - - select - procedures.patient_id - , procedures.procedure_date - , procedures.code_type - , procedures.code - , exclusion_codes.concept_name - from procedures - inner join exclusion_codes - on procedures.code = exclusion_codes.code - and procedures.code_type = exclusion_codes.code_system - -) - -, patients_with_frailty as ( - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - , coalesce( - med_claim_exclusions.claim_start_date - , med_claim_exclusions.claim_end_date - ) as exclusion_date - , med_claim_exclusions.concept_name - from denominator - inner join med_claim_exclusions - on denominator.patient_id = med_claim_exclusions.patient_id - where denominator.age >= 66 - and med_claim_exclusions.concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - ) - and ( - med_claim_exclusions.claim_start_date - between denominator.performance_period_begin - and denominator.performance_period_end - or med_claim_exclusions.claim_end_date - between denominator.performance_period_begin - and denominator.performance_period_end - ) - - union all - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - , condition_exclusions.condition_date as exclusion_date - , condition_exclusions.concept_name - from denominator - inner join condition_exclusions - on denominator.patient_id = condition_exclusions.patient_id - where denominator.age >= 66 - and condition_exclusions.concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - ) - and condition_exclusions.condition_date - between denominator.performance_period_begin - and denominator.performance_period_end - - union all - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - , procedure_exclusions.procedure_date as exclusion_date - , procedure_exclusions.concept_name - from denominator - inner join procedure_exclusions - on denominator.patient_id = procedure_exclusions.patient_id - where denominator.age >= 66 - and procedure_exclusions.concept_name in ( - 'Frailty Device' - , 'Frailty Diagnosis' - , 'Frailty Encounter' - , 'Frailty Symptom' - ) - and procedure_exclusions.procedure_date - between denominator.performance_period_begin - and denominator.performance_period_end - -) - -, frailty_with_dementia as ( - - select - patients_with_frailty.patient_id - , patients_with_frailty.exclusion_date - , patients_with_frailty.concept_name - || ' with ' - || pharmacy_claim_exclusions.concept_name - as exclusion_reason - from patients_with_frailty - inner join pharmacy_claim_exclusions - on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id - where ( - pharmacy_claim_exclusions.dispensing_date - between patients_with_frailty.performance_period_begin - and patients_with_frailty.performance_period_end - or pharmacy_claim_exclusions.paid_date - between patients_with_frailty.performance_period_begin - and patients_with_frailty.performance_period_end - ) - -) - -select - patient_id - , exclusion_date - , exclusion_reason -from frailty_with_dementia \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql b/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql deleted file mode 100644 index ce71c3d00..000000000 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_mastectomy.sql +++ /dev/null @@ -1,137 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} - -/* - Patients that had a mastectomy performed or who have a history of mastectomy -*/ - -with denominator as ( - - select - patient_id - , performance_period_begin - , performance_period_end - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} - -) - -, exclusion_codes as ( - - select - code - , code_system - , concept_name - from {{ ref('quality_measures_reporting__value_sets') }} - where concept_name in ( - 'Bilateral Mastectomy' - , 'History of bilateral mastectomy' - , 'Status Post Left Mastectomy' - , 'Status Post Right Mastectomy' - , 'Unilateral Mastectomy Left' - , 'Unilateral Mastectomy Right' - , 'Unilateral Mastectomy, Unspecified Laterality' - ) - -) - -, conditions as ( - - select - patient_id - , condition_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__condition') }} - -) - -, procedures as ( - - select - patient_id - , procedure_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__procedure') }} - -) - -, condition_exclusions as ( - - select - conditions.patient_id - , conditions.condition_date - , conditions.code_type - , conditions.code - , exclusion_codes.concept_name - from conditions - inner join exclusion_codes - on conditions.code = exclusion_codes.code - and conditions.code_type = exclusion_codes.code_system - -) - -, procedure_exclusions as ( - - select - procedures.patient_id - , procedures.procedure_date - , procedures.code_type - , procedures.code - , exclusion_codes.concept_name - from procedures - inner join exclusion_codes - on procedures.code = exclusion_codes.code - and procedures.code_type = exclusion_codes.code_system - -) - -, mastectomy_conditions as ( - - select - denominator.patient_id - , condition_exclusions.condition_date as exclusion_date - , condition_exclusions.concept_name as exclusion_reason - from denominator - inner join condition_exclusions - on denominator.patient_id = condition_exclusions.patient_id - -) - -, mastectomy_procedures as ( - - select - denominator.patient_id - , procedure_exclusions.procedure_date as exclusion_date - , procedure_exclusions.concept_name as exclusion_reason - from denominator - inner join procedure_exclusions - on denominator.patient_id = procedure_exclusions.patient_id - -) - -, exclusions_unioned as ( - - select - patient_id - , exclusion_date - , exclusion_reason - from mastectomy_conditions - - union all - - select - patient_id - , exclusion_date - , exclusion_reason - from mastectomy_procedures - -) - -select - patient_id - , exclusion_date - , exclusion_reason -from exclusions_unioned \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_palliative.sql b/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_palliative.sql deleted file mode 100644 index fff8e385d..000000000 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_exclude_palliative.sql +++ /dev/null @@ -1,146 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} - -/* - Palliative care services used by patient any time during the measurement period -*/ -with denominator as ( - - select - patient_id - , performance_period_begin - , performance_period_end - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} - -) - -, exclusion_codes as ( - - select - code - , code_system - , concept_name - from {{ ref('quality_measures_reporting__value_sets') }} - where concept_name in ( - 'Palliative Care Encounter' - , 'Palliative Care Intervention' - ) - -) - -, medical_claim as ( - - select - patient_id - , claim_start_date - , claim_end_date - , hcpcs_code - , place_of_service_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} - -) - -, procedures as ( - - select - patient_id - , procedure_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__procedure') }} - -) - -, med_claim_exclusions as ( - - select - medical_claim.patient_id - , medical_claim.claim_start_date - , medical_claim.claim_end_date - , medical_claim.hcpcs_code - , exclusion_codes.concept_name - from medical_claim - inner join exclusion_codes - on medical_claim.hcpcs_code = exclusion_codes.code - where exclusion_codes.code_system = 'hcpcs' - -) - -, procedure_exclusions as ( - - select - procedures.patient_id - , procedures.procedure_date - , procedures.code_type - , procedures.code - , exclusion_codes.concept_name - from procedures - inner join exclusion_codes - on procedures.code = exclusion_codes.code - and procedures.code_type = exclusion_codes.code_system - -) - -, palliative_claims as ( - - select - denominator.patient_id - , coalesce( - med_claim_exclusions.claim_start_date - , med_claim_exclusions.claim_end_date - ) as exclusion_date - , med_claim_exclusions.concept_name as exclusion_reason - from denominator - inner join med_claim_exclusions - on denominator.patient_id = med_claim_exclusions.patient_id - where ( - med_claim_exclusions.claim_start_date - between denominator.performance_period_begin - and denominator.performance_period_end - or med_claim_exclusions.claim_end_date - between denominator.performance_period_begin - and denominator.performance_period_end - ) - -) - -, palliative_procedures as ( - - select - denominator.patient_id - , procedure_exclusions.procedure_date as exclusion_date - , procedure_exclusions.concept_name as exclusion_reason - from denominator - inner join procedure_exclusions - on denominator.patient_id = procedure_exclusions.patient_id - where procedure_exclusions.procedure_date - between denominator.performance_period_begin - and denominator.performance_period_end - -) - -, exclusions_unioned as ( - - select - patient_id - , exclusion_date - , exclusion_reason - from palliative_claims - - union all - - select - patient_id - , exclusion_date - , exclusion_reason - from palliative_procedures - -) - -select - patient_id - , exclusion_date - , exclusion_reason -from exclusions_unioned \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_numerator.sql b/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_numerator.sql deleted file mode 100644 index 8d28d24fa..000000000 --- a/models/quality_measures/quality_measures_reporting/intermediate/quality_measures_reporting__int_nqf2372_numerator.sql +++ /dev/null @@ -1,158 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} - -/* - Eligible population from the denominator model before exclusions -*/ -with denominator as ( - - select - patient_id - , performance_period_begin - , performance_period_end - , measure_id - , measure_name - , measure_version - from {{ ref('quality_measures_reporting__int_nqf2372_denominator') }} - -) - -, mammography_codes as ( - - select - code - , code_system - from {{ ref('quality_measures_reporting__value_sets') }} - where concept_name = 'Mammography' - -) - -, medical_claim as ( - - select - patient_id - , claim_start_date - , claim_end_date - , hcpcs_code - from {{ ref('quality_measures_reporting__stg_medical_claim') }} - -) - -, procedures as ( - - select - patient_id - , procedure_date - , code_type - , code - from {{ ref('quality_measures_reporting__stg_core__procedure') }} - -) - -, qualifying_claims as ( - - select - medical_claim.patient_id - , medical_claim.claim_start_date - , medical_claim.claim_end_date - from medical_claim - inner join mammography_codes - on medical_claim.hcpcs_code = mammography_codes.code - where mammography_codes.code_system = 'hcpcs' - -) - -, qualifying_procedures as ( - - select - procedures.patient_id - , procedures.procedure_date - , procedures.code_type - , procedures.code - from procedures - inner join mammography_codes - on procedures.code = mammography_codes.code - and procedures.code_type = mammography_codes.code_system - -) - -/* - Check if patients in the eligible population have had a screening, - diagnostic, film, digital or digital breast tomosynthesis (3D) - mammography results documented and reviewed. -*/ - -, patients_with_mammograms as ( - - select - denominator.patient_id - , denominator.performance_period_begin - , denominator.performance_period_end - , denominator.measure_id - , denominator.measure_name - , denominator.measure_version - , coalesce( - qualifying_procedures.procedure_date - , qualifying_claims.claim_start_date - , qualifying_claims.claim_end_date - ) as evidence_date - , case - when qualifying_claims.claim_start_date >= denominator.performance_period_begin - or qualifying_claims.claim_end_date <= denominator.performance_period_end - then 1 - when qualifying_procedures.procedure_date >= denominator.performance_period_begin - or qualifying_procedures.procedure_date <= denominator.performance_period_end - then 1 - else 0 - end as numerator_flag - from denominator - left join qualifying_claims - on denominator.patient_id = qualifying_claims.patient_id - left join qualifying_procedures - on denominator.patient_id = qualifying_procedures.patient_id - -) - -, numerator as ( - - select distinct - patient_id - , performance_period_begin - , performance_period_end - , measure_id - , measure_name - , measure_version - , evidence_date - , numerator_flag - from patients_with_mammograms - -) - -, add_data_types as ( - - select - cast(patient_id as {{ dbt.type_string() }}) as patient_id - , cast(performance_period_begin as date) as performance_period_begin - , cast(performance_period_end as date) as performance_period_end - , cast(measure_id as {{ dbt.type_string() }}) as measure_id - , cast(measure_name as {{ dbt.type_string() }}) as measure_name - , cast(measure_version as {{ dbt.type_string() }}) as measure_version - , cast(evidence_date as date) as evidence_date - , cast(numerator_flag as integer) as numerator_flag - from numerator - -) - -select - patient_id - , performance_period_begin - , performance_period_end - , measure_id - , measure_name - , measure_version - , evidence_date - , numerator_flag - , '{{ var('tuva_last_run')}}' as tuva_last_run -from add_data_types \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__condition.sql b/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__condition.sql deleted file mode 100644 index b1ed7e3db..000000000 --- a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__condition.sql +++ /dev/null @@ -1,12 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} -select - patient_id - , claim_id - , recorded_date as condition_date - , normalized_code_type as code_type - , normalized_code as code - , '{{ var('tuva_last_run')}}' as tuva_last_run -from {{ ref('core__condition') }} \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__procedure.sql b/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__procedure.sql deleted file mode 100644 index 2d3bd42dd..000000000 --- a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__procedure.sql +++ /dev/null @@ -1,11 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} -select - patient_id - , procedure_date - , normalized_code_type as code_type - , normalized_code as code - , '{{ var('tuva_last_run')}}' as tuva_last_run -from {{ ref('core__procedure') }} \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_medical_claim.sql b/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_medical_claim.sql deleted file mode 100644 index 51d16c0f1..000000000 --- a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_medical_claim.sql +++ /dev/null @@ -1,13 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} -select - patient_id - , claim_id - , claim_start_date - , claim_end_date - , place_of_service_code - , hcpcs_code - , '{{ var('tuva_last_run')}}' as tuva_last_run -from {{ ref('medical_claim') }} \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_pharmacy_claim.sql b/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_pharmacy_claim.sql deleted file mode 100644 index 8a1e20ae1..000000000 --- a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_pharmacy_claim.sql +++ /dev/null @@ -1,11 +0,0 @@ -{{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) - ) -}} -select - patient_id - , dispensing_date - , ndc_code - , paid_date - , '{{ var('tuva_last_run')}}' as tuva_last_run -from {{ ref('pharmacy_claim') }} \ No newline at end of file diff --git a/models/quality_measures/staging/quality_measures__stg_core__condition.sql b/models/quality_measures/staging/quality_measures__stg_core__condition.sql new file mode 100644 index 000000000..f8f6b6e6b --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_core__condition.sql @@ -0,0 +1,14 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} +select + patient_id + , claim_id + , recorded_date + , source_code_type + , source_code + , normalized_code_type + , normalized_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__condition') }} \ No newline at end of file diff --git a/models/quality_measures/staging/quality_measures__stg_core__encounter.sql b/models/quality_measures/staging/quality_measures__stg_core__encounter.sql new file mode 100644 index 000000000..1b0283923 --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_core__encounter.sql @@ -0,0 +1,36 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , encounter_type + , encounter_start_date + , encounter_end_date + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__encounter') }} + +{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , encounter_type + , encounter_start_date + , encounter_end_date + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__encounter') }} + +{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + cast(null as {{ dbt.type_string() }} ) as patient_id + , cast(null as {{ dbt.type_string() }} ) as encounter_type + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_end_date + , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run +limit 0 + +{%- endif %} \ No newline at end of file diff --git a/models/quality_measures/staging/quality_measures__stg_core__medication.sql b/models/quality_measures/staging/quality_measures__stg_core__medication.sql new file mode 100644 index 000000000..dcbb3667e --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_core__medication.sql @@ -0,0 +1,42 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , dispensing_date + , source_code_type + , source_code + , ndc_code + , rxnorm_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__medication') }} + +{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , dispensing_date + , source_code_type + , source_code + , ndc_code + , rxnorm_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__medication') }} + +{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + cast(null as {{ dbt.type_string() }} ) as patient_id + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date + , cast(null as {{ dbt.type_string() }} ) as source_code_type + , cast(null as {{ dbt.type_string() }} ) as source_code + , cast(null as {{ dbt.type_string() }} ) as ndc_code + , cast(null as {{ dbt.type_string() }} ) as rxnorm_code + , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run +limit 0 + +{%- endif %} \ No newline at end of file diff --git a/models/quality_measures/staging/quality_measures__stg_core__observation.sql b/models/quality_measures/staging/quality_measures__stg_core__observation.sql new file mode 100644 index 000000000..285aa51ac --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_core__observation.sql @@ -0,0 +1,42 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , observation_date + , source_code_type + , source_code + , normalized_code_type + , normalized_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__observation') }} + +{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , observation_date + , source_code_type + , source_code + , normalized_code_type + , normalized_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__observation') }} + +{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + cast(null as {{ dbt.type_string() }} ) as patient_id + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date + , cast(null as {{ dbt.type_string() }} ) as source_code_type + , cast(null as {{ dbt.type_string() }} ) as source_code + , cast(null as {{ dbt.type_string() }} ) as normalized_code_type + , cast(null as {{ dbt.type_string() }} ) as normalized_code + , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run +limit 0 + +{%- endif %} \ No newline at end of file diff --git a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__patient.sql b/models/quality_measures/staging/quality_measures__stg_core__patient.sql similarity index 54% rename from models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__patient.sql rename to models/quality_measures/staging/quality_measures__stg_core__patient.sql index 452b56fe8..030980537 100644 --- a/models/quality_measures/quality_measures_reporting/staging/quality_measures_reporting__stg_core__patient.sql +++ b/models/quality_measures/staging/quality_measures__stg_core__patient.sql @@ -1,10 +1,10 @@ {{ config( - enabled = var('quality_measures_reporting_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) ) }} select patient_id - , sex as gender + , sex , birth_date , death_date , '{{ var('tuva_last_run')}}' as tuva_last_run diff --git a/models/quality_measures/staging/quality_measures__stg_core__procedure.sql b/models/quality_measures/staging/quality_measures__stg_core__procedure.sql new file mode 100644 index 000000000..c11c0edd9 --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_core__procedure.sql @@ -0,0 +1,13 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} +select + patient_id + , procedure_date + , source_code_type + , source_code + , normalized_code_type + , normalized_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('core__procedure') }} \ No newline at end of file diff --git a/models/quality_measures/staging/quality_measures__stg_medical_claim.sql b/models/quality_measures/staging/quality_measures__stg_medical_claim.sql new file mode 100644 index 000000000..5c2df7faa --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_medical_claim.sql @@ -0,0 +1,42 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , claim_id + , claim_start_date + , claim_end_date + , place_of_service_code + , hcpcs_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('medical_claim') }} + +{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , claim_id + , claim_start_date + , claim_end_date + , place_of_service_code + , hcpcs_code + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('medical_claim') }} + +{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + cast(null as {{ dbt.type_string() }} ) as patient_id + , cast(null as {{ dbt.type_string() }} ) as claim_id + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_start_date + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_end_date + , cast(null as {{ dbt.type_string() }} ) as place_of_service_code + , cast(null as {{ dbt.type_string() }} ) as hcpcs_code + , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run +limit 0 + +{%- endif %} \ No newline at end of file diff --git a/models/quality_measures/staging/quality_measures__stg_pharmacy_claim.sql b/models/quality_measures/staging/quality_measures__stg_pharmacy_claim.sql new file mode 100644 index 000000000..ac10cd018 --- /dev/null +++ b/models/quality_measures/staging/quality_measures__stg_pharmacy_claim.sql @@ -0,0 +1,36 @@ +{{ config( + enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + ) +}} + +{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , dispensing_date + , ndc_code + , paid_date + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('pharmacy_claim') }} + +{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + patient_id + , dispensing_date + , ndc_code + , paid_date + , '{{ var('tuva_last_run')}}' as tuva_last_run +from {{ ref('pharmacy_claim') }} + +{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%} + +select + cast(null as {{ dbt.type_string() }} ) as patient_id + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date + , cast(null as {{ dbt.type_string() }} ) as ndc_code + , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date + , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run +limit 0 + +{%- endif %} \ No newline at end of file diff --git a/seeds/value_sets/quality_measures_reporting/quality_measures_reporting__concepts.csv b/seeds/value_sets/quality_measures/quality_measures__concepts.csv similarity index 100% rename from seeds/value_sets/quality_measures_reporting/quality_measures_reporting__concepts.csv rename to seeds/value_sets/quality_measures/quality_measures__concepts.csv diff --git a/seeds/value_sets/quality_measures_reporting/quality_measures_reporting__measures.csv b/seeds/value_sets/quality_measures/quality_measures__measures.csv similarity index 100% rename from seeds/value_sets/quality_measures_reporting/quality_measures_reporting__measures.csv rename to seeds/value_sets/quality_measures/quality_measures__measures.csv diff --git a/seeds/value_sets/quality_measures_reporting/quality_measures_reporting__value_sets.csv b/seeds/value_sets/quality_measures/quality_measures__value_sets.csv similarity index 100% rename from seeds/value_sets/quality_measures_reporting/quality_measures_reporting__value_sets.csv rename to seeds/value_sets/quality_measures/quality_measures__value_sets.csv diff --git a/seeds/value_sets/quality_measures/quality_measures_seeds.yml b/seeds/value_sets/quality_measures/quality_measures_seeds.yml new file mode 100644 index 000000000..f39c9c43c --- /dev/null +++ b/seeds/value_sets/quality_measures/quality_measures_seeds.yml @@ -0,0 +1,32 @@ +version: 2 + +seeds: + - name: quality_measures__measures + description: Overview of reporting measures. + config: + schema: | + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} + alias: _value_set_measures + tags: quality_measures + enabled: "{{ var('quality_measures_enabled',var('tuva_marts_enabled',True)) }}" + + - name: quality_measures__concepts + description: Measures to concepts crosswalk. List of concepts used in each reporting measure. + config: + schema: | + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} + alias: _value_set_concepts + tags: quality_measures + enabled: "{{ var('quality_measures_enabled',var('tuva_marts_enabled',True)) }}" + + - name: quality_measures__value_sets + description: Concepts to value sets crosswalk. List of codes in each concept. + config: + schema: | + {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} + alias: _value_set_codes + tags: quality_measures + enabled: "{{ var('quality_measures_enabled',var('tuva_marts_enabled',True)) }}" + column_types: + code: | + {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar {%- endif -%} \ No newline at end of file diff --git a/seeds/value_sets/quality_measures_reporting/quality_measures_reporting_seeds.yml b/seeds/value_sets/quality_measures_reporting/quality_measures_reporting_seeds.yml deleted file mode 100644 index d0442ce48..000000000 --- a/seeds/value_sets/quality_measures_reporting/quality_measures_reporting_seeds.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: 2 - -seeds: - - name: quality_measures_reporting__measures - description: Overview of reporting measures. - config: - schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} - alias: _value_set_measures - tags: quality_measures_reporting - enabled: "{{ var('quality_measures_reporting_enabled',var('tuva_marts_enabled',True)) }}" - - - name: quality_measures_reporting__concepts - description: Measures to concepts crosswalk. List of concepts used in each reporting measure. - config: - schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} - alias: _value_set_concepts - tags: quality_measures_reporting - enabled: "{{ var('quality_measures_reporting_enabled',var('tuva_marts_enabled',True)) }}" - - - name: quality_measures_reporting__value_sets - description: Concepts to value sets crosswalk. List of codes in each concept. - config: - schema: | - {%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures_reporting{% else %}quality_measures_reporting{%- endif -%} - alias: _value_set_codes - tags: quality_measures_reporting - enabled: "{{ var('quality_measures_reporting_enabled',var('tuva_marts_enabled',True)) }}" - column_types: - code: | - {%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar {%- endif -%} \ No newline at end of file diff --git a/snapshots/quality_measures/quality_measures__summary_counts_snapshot.sql b/snapshots/quality_measures/quality_measures__summary_counts_snapshot.sql new file mode 100644 index 000000000..9e7aacb63 --- /dev/null +++ b/snapshots/quality_measures/quality_measures__summary_counts_snapshot.sql @@ -0,0 +1,21 @@ +{% snapshot quality_measures__summary_counts_snapshot %} + +{% set schema_var %} +{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} +{% endset %} + +{{ + config({ + "target_schema": schema_var + , "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": var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + }) +}} + +select * from {{ ref('quality_measures__summary_counts') }} + +{% endsnapshot %} \ No newline at end of file diff --git a/snapshots/quality_measures/quality_measures__summary_long_snapshot.sql b/snapshots/quality_measures/quality_measures__summary_long_snapshot.sql new file mode 100644 index 000000000..4d92723dd --- /dev/null +++ b/snapshots/quality_measures/quality_measures__summary_long_snapshot.sql @@ -0,0 +1,21 @@ +{% snapshot quality_measures__summary_long_snapshot %} + +{% set schema_var %} +{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%} +{% endset %} + +{{ + config({ + "target_schema": schema_var + , "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": var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) + }) +}} + +select * from {{ ref('quality_measures__summary_long') }} + +{% endsnapshot %} \ No newline at end of file