diff --git a/dbt_project.yml b/dbt_project.yml index d5738625e..31a35ad73 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'the_tuva_project' -version: '0.5.2' +version: '0.5.3' config-version: 2 require-dbt-version: ">=1.3.0" diff --git a/docs/catalog.json b/docs/catalog.json index d75fbf338..39e00ca0d 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.5.1", "generated_at": "2023-09-18T13:43:09.532441Z", "invocation_id": "7e2f524c-12d6-406b-b606-20d056e199a6", "env": {}}, "nodes": {"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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, "model.the_tuva_project.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_condition_with_class": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_CONDITION_WITH_CLASS", "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}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 8, "name": "RECORDED_DATE", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 9, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 10, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 11, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 12, "name": "CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_class"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "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": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.claims_data_model.encounter": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, "seed.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, "model.the_tuva_project.core__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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.claims_data_model.medication": {"metadata": {"type": "VIEW", "schema": "TEST", "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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"}, "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "model.the_tuva_project.quality_measures__int_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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, "seed.the_tuva_project.terminology__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, "model.the_tuva_project.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, "model.the_tuva_project.service_category__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__summary": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "SUMMARY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION": {"type": "TEXT", "index": 1, "name": "CLASSIFICATION", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 4, "name": "RECORDED_DATE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 8, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 9, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 10, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 11, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 12, "name": "SERVICE_CATEGORY_2", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 14, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 15, "name": "PROVIDER_LAST_NAME", "comment": null}, "PROVIDER_ORGANIZATION_NAME": {"type": "TEXT", "index": 16, "name": "PROVIDER_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME": {"type": "TEXT", "index": 17, "name": "PROVIDER_PARENT_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PRACTICE_STATE": {"type": "TEXT", "index": 18, "name": "PROVIDER_PRACTICE_STATE", "comment": null}, "PROVIDER_PRACTICE_ZIP_CODE": {"type": "TEXT", "index": 19, "name": "PROVIDER_PRACTICE_ZIP_CODE", "comment": null}, "PATIENT_GENDER": {"type": "TEXT", "index": 20, "name": "PATIENT_GENDER", "comment": null}, "PATIENT_BIRTH_DATE": {"type": "DATE", "index": 21, "name": "PATIENT_BIRTH_DATE", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 22, "name": "PATIENT_AGE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 23, "name": "PATIENT_RACE", "comment": null}, "PATIENT_STATE": {"type": "TEXT", "index": 24, "name": "PATIENT_STATE", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 25, "name": "CLASSIFICATION_NAME", "comment": null}, "CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 26, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_COLUMN": {"type": "TEXT", "index": 27, "name": "CLASSIFICATION_COLUMN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__summary"}, "model.the_tuva_project.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, "model.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_by_provider_parent_organization": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PARENT_ORGANIZATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_parent_organization"}, "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__claim_categorization": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_CLAIM_CATEGORIZATION", "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}, "CONDITION_COUNT": {"type": "NUMBER", "index": 3, "name": "CONDITION_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__claim_categorization"}, "model.the_tuva_project.ed_classification__stg_condition": {"metadata": {"type": "VIEW", "schema": "ED_CLASSIFICATION", "name": "ED_CLASSIFICATION__STG_CONDITION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_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}, "RECORDED_DATE": {"type": "DATE", "index": 4, "name": "RECORDED_DATE", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 6, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 8, "name": "CONDITION_RANK", "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.ed_classification__stg_condition"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-11 21:04UTC", "include": true, "description": "The timestamp for last update/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.quality_measures__summary_counts_snapshot"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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": "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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": 2000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 23040.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/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.quality_measures__summary_long_snapshot"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.claims_data_model.procedure": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, "model.the_tuva_project.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, "model.the_tuva_project.data_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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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__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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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__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_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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, "model.the_tuva_project.core__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"}, "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, "seed.the_tuva_project.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, "seed.the_tuva_project.readmissions__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, "model.the_tuva_project.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.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__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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_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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, "model.the_tuva_project.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, "model.the_tuva_project.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.claims_data_model.location": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, "seed.the_tuva_project.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, "model.the_tuva_project.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.ed_classification__int_primary_dx_per_claim": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_PRIMARY_DX_PER_CLAIM", "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}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 8, "name": "RECORDED_DATE", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 9, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_primary_dx_per_claim"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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": 244603392.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__unclassified_rows": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_UNCLASSIFIED_ROWS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"RECORDED_DATE_YEAR": {"type": "TEXT", "index": 1, "name": "RECORDED_DATE_YEAR", "comment": null}, "UNIQUE_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 2, "name": "UNIQUE_CODES_IN_CCS_COUNT", "comment": null}, "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 3, "name": "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT", "comment": null}, "CONDITION_ROW_COUNT": {"type": "NUMBER", "index": 4, "name": "CONDITION_ROW_COUNT", "comment": null}, "CONDITION_ROW_UNCLASSIFIED_PERCENT": {"type": "NUMBER", "index": 5, "name": "CONDITION_ROW_UNCLASSIFIED_PERCENT", "comment": null}, "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__unclassified_rows"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__johnston_icd9": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD9", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD9": {"type": "TEXT", "index": 1, "name": "ICD9", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 7443.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 57344.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, "model.the_tuva_project.ed_classification__int_by_year": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_YEAR", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 4, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 5, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_by_year"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, "model.the_tuva_project.core__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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__observation"}, "seed.the_tuva_project.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, "model.the_tuva_project.data_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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__johnston_icd10": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD10", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD10": {"type": "TEXT", "index": 1, "name": "ICD10", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 47132.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 350208.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, "seed.the_tuva_project.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.claims_data_model.condition": {"metadata": {"type": "VIEW", "schema": "TEST", "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"}, "seed.the_tuva_project.ed_classification__categories": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_CATEGORIES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION": {"type": "TEXT", "index": 1, "name": "CLASSIFICATION", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 3, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_COLUMN": {"type": "TEXT", "index": 4, "name": "CLASSIFICATION_COLUMN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_by_ccs_description": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_CCS_DESCRIPTION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_by_ccs_description"}, "model.claims_data_model.lab_result": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_condition_with_claim": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_CONDITION_WITH_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 3, "name": "RECORDED_DATE", "comment": null}, "CODE": {"type": "TEXT", "index": 4, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 5, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 6, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 7, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 8, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 9, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 10, "name": "CLASSIFICATION", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 11, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 12, "name": "SERVICE_CATEGORY_2", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 14, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 15, "name": "PROVIDER_LAST_NAME", "comment": null}, "PROVIDER_ORGANIZATION_NAME": {"type": "TEXT", "index": 16, "name": "PROVIDER_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME": {"type": "TEXT", "index": 17, "name": "PROVIDER_PARENT_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PRACTICE_STATE": {"type": "TEXT", "index": 18, "name": "PROVIDER_PRACTICE_STATE", "comment": null}, "PROVIDER_PRACTICE_ZIP_CODE": {"type": "TEXT", "index": 19, "name": "PROVIDER_PRACTICE_ZIP_CODE", "comment": null}, "PATIENT_GENDER": {"type": "TEXT", "index": 20, "name": "PATIENT_GENDER", "comment": null}, "PATIENT_BIRTH_DATE": {"type": "DATE", "index": 21, "name": "PATIENT_BIRTH_DATE", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 22, "name": "PATIENT_AGE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 23, "name": "PATIENT_RACE", "comment": null}, "PATIENT_STATE": {"type": "TEXT", "index": 24, "name": "PATIENT_STATE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__gender"}, "model.the_tuva_project.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.claims_data_model.practitioner": {"metadata": {"type": "VIEW", "schema": "TEST", "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.ed_classification__unclassified_conditions": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_UNCLASSIFIED_CONDITIONS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 1, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "UNIQUE_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 2, "name": "UNIQUE_CODES_IN_CCS_COUNT", "comment": null}, "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 3, "name": "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT", "comment": null}, "CONDITION_ROW_COUNT": {"type": "NUMBER", "index": 4, "name": "CONDITION_ROW_COUNT", "comment": null}, "CONDITION_ROW_UNCLASSIFIED_PERCENT": {"type": "NUMBER", "index": 5, "name": "CONDITION_ROW_UNCLASSIFIED_PERCENT", "comment": null}, "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__unclassified_conditions"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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__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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__encounter"}, "seed.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, "model.the_tuva_project.data_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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__mdc"}, "model.the_tuva_project.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, "model.the_tuva_project.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__procedure"}, "model.the_tuva_project.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_by_year_month": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_YEAR_MONTH", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 4, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_by_year_month"}, "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.claims_data_model.patient": {"metadata": {"type": "VIEW", "schema": "TEST", "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"}, "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": 3000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 141824.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_merge_condition": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_MERGE_CONDITION", "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}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 8, "name": "RECORDED_DATE", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 9, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 10, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 11, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 12, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 13, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 14, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 15, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 16, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 17, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 18, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_merge_condition"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_by_patient_race": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PATIENT_RACE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 4, "name": "PATIENT_RACE", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_by_patient_race"}, "model.the_tuva_project.ed_classification__int_by_provider_practice_state": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PRACTICE_STATE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "PROVIDER_PRACTICE_STATE": {"type": "TEXT", "index": 4, "name": "PROVIDER_PRACTICE_STATE", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_practice_state"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "seed.the_tuva_project.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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.observation": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "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"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, "seed.the_tuva_project.terminology__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, "model.the_tuva_project.quality_measures__int_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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, "seed.the_tuva_project.terminology__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-18 13:37UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, "model.the_tuva_project.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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"}, "bytes": {"id": "bytes", "label": "Approximate Size", "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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.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.ed_classification__int_patient_list": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_PATIENT_LIST", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "SEX": {"type": "TEXT", "index": 2, "name": "SEX", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 3, "name": "BIRTH_DATE", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "STATE": {"type": "TEXT", "index": 5, "name": "STATE", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 6, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 7, "name": "RECORDED_DATE", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 8, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 9, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CODE_TYPE": {"type": "TEXT", "index": 10, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 11, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 13, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 14, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 15, "name": "CLASSIFICATION", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 16, "name": "CLASSIFICATION_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-18 13:38UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_patient_list"}, "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-18 13:37UTC", "include": true, "description": "The timestamp for last update/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"}, "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": 3000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 125440.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-18 13:38UTC", "include": true, "description": "The timestamp for last update/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"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.5.1", "generated_at": "2023-09-20T12:50:28.729753Z", "invocation_id": "a2f9bb74-6e78-4b20-b34d-c110dc64cef3", "env": {}}, "nodes": {"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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1583.0, "include": true, "description": "An approximate count of rows in this table"}, "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.claims_data_model.observation": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 55.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.ed_classification__int_patient_list": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_PATIENT_LIST", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "SEX": {"type": "TEXT", "index": 2, "name": "SEX", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 3, "name": "BIRTH_DATE", "comment": null}, "RACE": {"type": "TEXT", "index": 4, "name": "RACE", "comment": null}, "STATE": {"type": "TEXT", "index": 5, "name": "STATE", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 6, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 7, "name": "RECORDED_DATE", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 8, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 9, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CODE_TYPE": {"type": "TEXT", "index": 10, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 11, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 13, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 14, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 15, "name": "CLASSIFICATION", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 16, "name": "CLASSIFICATION_NAME", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_patient_list"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7501.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-11 21:04UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 65.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "model.claims_data_model.condition": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "seed.the_tuva_project.ed_classification__categories": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_CATEGORIES", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION": {"type": "TEXT", "index": 1, "name": "CLASSIFICATION", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 3, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_COLUMN": {"type": "TEXT", "index": 4, "name": "CLASSIFICATION_COLUMN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__categories"}, "model.the_tuva_project.ed_classification__int_merge_condition": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_MERGE_CONDITION", "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}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 8, "name": "RECORDED_DATE", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 9, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 10, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 11, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 12, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 13, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 14, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 15, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 16, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 17, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 18, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_merge_condition"}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD10", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD10": {"type": "TEXT", "index": 1, "name": "ICD10", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 47132.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 350208.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.ed_classification__johnston_icd10"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "model.claims_data_model.patient": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 125440.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 86288.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2373632.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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__stg_condition": {"metadata": {"type": "VIEW", "schema": "ED_CLASSIFICATION", "name": "ED_CLASSIFICATION__STG_CONDITION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_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}, "RECORDED_DATE": {"type": "DATE", "index": 4, "name": "RECORDED_DATE", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 6, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 8, "name": "CONDITION_RANK", "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.ed_classification__stg_condition"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "model.the_tuva_project.ed_classification__int_by_provider_practice_state": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PRACTICE_STATE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "PROVIDER_PRACTICE_STATE": {"type": "TEXT", "index": 4, "name": "PROVIDER_PRACTICE_STATE", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_provider_practice_state"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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_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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_PRIMARY_DX_PER_CLAIM", "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}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 8, "name": "RECORDED_DATE", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 9, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_primary_dx_per_claim"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 2000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 23040.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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.claims_data_model.procedure": {"metadata": {"type": "VIEW", "schema": "TEST", "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_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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 78.0, "include": true, "description": "An approximate count of rows in this table"}, "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.claims_data_model.practitioner": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 2521.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 11.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "model.the_tuva_project.ed_classification__unclassified_conditions": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_UNCLASSIFIED_CONDITIONS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 1, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "UNIQUE_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 2, "name": "UNIQUE_CODES_IN_CCS_COUNT", "comment": null}, "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 3, "name": "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT", "comment": null}, "CONDITION_ROW_COUNT": {"type": "NUMBER", "index": 4, "name": "CONDITION_ROW_COUNT", "comment": null}, "CONDITION_ROW_UNCLASSIFIED_PERCENT": {"type": "NUMBER", "index": 5, "name": "CONDITION_ROW_UNCLASSIFIED_PERCENT", "comment": null}, "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__unclassified_conditions"}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD9", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD9": {"type": "TEXT", "index": 1, "name": "ICD9", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7443.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 57344.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.ed_classification__johnston_icd9"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 29.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 50.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6532.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_year_month": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_YEAR_MONTH", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 4, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_year_month"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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": 244597760.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.ed_classification__int_condition_with_claim": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_CONDITION_WITH_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 3, "name": "RECORDED_DATE", "comment": null}, "CODE": {"type": "TEXT", "index": 4, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 5, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 6, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 7, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 8, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 9, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 10, "name": "CLASSIFICATION", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 11, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 12, "name": "SERVICE_CATEGORY_2", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 14, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 15, "name": "PROVIDER_LAST_NAME", "comment": null}, "PROVIDER_ORGANIZATION_NAME": {"type": "TEXT", "index": 16, "name": "PROVIDER_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME": {"type": "TEXT", "index": 17, "name": "PROVIDER_PARENT_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PRACTICE_STATE": {"type": "TEXT", "index": 18, "name": "PROVIDER_PRACTICE_STATE", "comment": null}, "PROVIDER_PRACTICE_ZIP_CODE": {"type": "TEXT", "index": 19, "name": "PROVIDER_PRACTICE_ZIP_CODE", "comment": null}, "PATIENT_GENDER": {"type": "TEXT", "index": 20, "name": "PATIENT_GENDER", "comment": null}, "PATIENT_BIRTH_DATE": {"type": "DATE", "index": 21, "name": "PATIENT_BIRTH_DATE", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 22, "name": "PATIENT_AGE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 23, "name": "PATIENT_RACE", "comment": null}, "PATIENT_STATE": {"type": "TEXT", "index": 24, "name": "PATIENT_STATE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_condition_with_claim"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 25.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 47.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, "model.the_tuva_project.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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.claims_data_model.location": {"metadata": {"type": "VIEW", "schema": "TEST", "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 14.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 74549.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_ccs_description": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_CCS_DESCRIPTION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_ccs_description"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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_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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 22.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80000.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1701.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 141824.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_condition_with_class": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_CONDITION_WITH_CLASS", "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}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 8, "name": "RECORDED_DATE", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 9, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 10, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 11, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 12, "name": "CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_condition_with_class"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__summary": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "SUMMARY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION": {"type": "TEXT", "index": 1, "name": "CLASSIFICATION", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 4, "name": "RECORDED_DATE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "CCS_DESCRIPTION_WITH_COVID": {"type": "TEXT", "index": 7, "name": "CCS_DESCRIPTION_WITH_COVID", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 8, "name": "RECORDED_DATE_YEAR", "comment": null}, "RECORDED_DATE_YEAR_MONTH": {"type": "TEXT", "index": 9, "name": "RECORDED_DATE_YEAR_MONTH", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 10, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 11, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 12, "name": "SERVICE_CATEGORY_2", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 14, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 15, "name": "PROVIDER_LAST_NAME", "comment": null}, "PROVIDER_ORGANIZATION_NAME": {"type": "TEXT", "index": 16, "name": "PROVIDER_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME": {"type": "TEXT", "index": 17, "name": "PROVIDER_PARENT_ORGANIZATION_NAME", "comment": null}, "PROVIDER_PRACTICE_STATE": {"type": "TEXT", "index": 18, "name": "PROVIDER_PRACTICE_STATE", "comment": null}, "PROVIDER_PRACTICE_ZIP_CODE": {"type": "TEXT", "index": 19, "name": "PROVIDER_PRACTICE_ZIP_CODE", "comment": null}, "PATIENT_GENDER": {"type": "TEXT", "index": 20, "name": "PATIENT_GENDER", "comment": null}, "PATIENT_BIRTH_DATE": {"type": "DATE", "index": 21, "name": "PATIENT_BIRTH_DATE", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 22, "name": "PATIENT_AGE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 23, "name": "PATIENT_RACE", "comment": null}, "PATIENT_STATE": {"type": "TEXT", "index": 24, "name": "PATIENT_STATE", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 25, "name": "CLASSIFICATION_NAME", "comment": null}, "CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 26, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_COLUMN": {"type": "TEXT", "index": 27, "name": "CLASSIFICATION_COLUMN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__summary"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 10.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80493.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "model.claims_data_model.lab_result": {"metadata": {"type": "VIEW", "schema": "TEST", "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.ed_classification__int_by_provider_parent_organization": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PARENT_ORGANIZATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_PARENT_ORGANIZATION_NAME_WITH_PROVIDER_NAME", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_provider_parent_organization"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 41.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, "seed.the_tuva_project.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 12333.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3882.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, "model.the_tuva_project.core__stg_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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3232.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.ed_classification__unclassified_rows": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_UNCLASSIFIED_ROWS", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"RECORDED_DATE_YEAR": {"type": "TEXT", "index": 1, "name": "RECORDED_DATE_YEAR", "comment": null}, "UNIQUE_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 2, "name": "UNIQUE_CODES_IN_CCS_COUNT", "comment": null}, "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT": {"type": "NUMBER", "index": 3, "name": "UNIQUE_UNCLASSIFIED_CODES_IN_CCS_COUNT", "comment": null}, "CONDITION_ROW_COUNT": {"type": "NUMBER", "index": 4, "name": "CONDITION_ROW_COUNT", "comment": null}, "CONDITION_ROW_UNCLASSIFIED_PERCENT": {"type": "NUMBER", "index": 5, "name": "CONDITION_ROW_UNCLASSIFIED_PERCENT", "comment": null}, "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "UNCLASSIFIED_CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__unclassified_rows"}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, "model.the_tuva_project.ed_classification__int_by_year": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_YEAR", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 4, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 5, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_year"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 526.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 16.0, "include": true, "description": "An approximate count of rows in this table"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.claims_data_model.encounter": {"metadata": {"type": "VIEW", "schema": "TEST", "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 276.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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.claims_data_model.medication": {"metadata": {"type": "VIEW", "schema": "TEST", "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.ed_classification__int_by_patient_race": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PATIENT_RACE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 1, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "RECORDED_DATE_YEAR": {"type": "TEXT", "index": 3, "name": "RECORDED_DATE_YEAR", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 4, "name": "PATIENT_RACE", "comment": null}, "CLAIM_COUNT": {"type": "NUMBER", "index": 5, "name": "CLAIM_COUNT", "comment": null}, "CLAIM_PAID_AMOUNT_SUM": {"type": "FLOAT", "index": 6, "name": "CLAIM_PAID_AMOUNT_SUM", "comment": null}, "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION": {"type": "NUMBER", "index": 7, "name": "PERCENT_CLAIM_COUNT_OF_CLASSIFICATION", "comment": null}, "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION": {"type": "FLOAT", "index": 8, "name": "PERCENT_CLAIM_PAID_AMOUNT_SUM_OF_CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__int_by_patient_race"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, "model.the_tuva_project.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:45UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__claim_categorization": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_CLAIM_CATEGORIZATION", "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}, "CONDITION_COUNT": {"type": "NUMBER", "index": 3, "name": "CONDITION_COUNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.ed_classification__claim_categorization"}, "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__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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "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"}, "has_stats": {"id": "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_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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:46UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}, "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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.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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-09-20 12:47UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "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"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 325285079..58f1f6211 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v9.json", "dbt_version": "1.5.1", "generated_at": "2023-09-18T13:42:56.426815Z", "invocation_id": "7e2f524c-12d6-406b-b606-20d056e199a6", "env": {}, "project_id": "228f02ae210381b07ccf62fcaa654d94", "user_id": "c5ffe329-cd24-4f82-be78-c62b00387d3d", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.claims_data_model.condition": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1839223, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "1e55465f5e10badfd895ead0a6d443e5b07a2ec789f9917d7108f9b36417ac2d"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.1788478, "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.encounter": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1995986, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.lab_result": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1995986, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.location": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1995986, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.2385423, "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.medication": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.observation": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.patient": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "/terminology/medications/ndc"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.2385423, "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.practitioner": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.procedure": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.2541661, "relation_name": "tuva.tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3183432, "relation_name": "tuva.tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "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": 1695044212.3183432, "relation_name": "tuva.tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "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": "b4b74e4440c0c015191981747b2a8cd39a2af7ee86438ce1752b9075eb447a06"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-CM diagnosis codes to the CCSR's clinically meaningful diagnosis categories. Each row represents a mapping of an ICD-10 code to a CCSR category. As each ICD-10 code may be mapped to up to 6 categories, it's expected that this table will output as many or more rows than the TUVA condition model. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-CM code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The description of the CCSR category as provided in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6823828, "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": [{"name": "ccsr__dx_vertical_pivot", "package": null, "version": null}, {"name": "ccsr__stg_core__condition", "package": null, "version": null}, {"name": "ccsr__dxccsr_v2023_1_body_systems", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_condition_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect *, '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-PCS procedure codes to the CCSR's clinically meaningful procedure categories. Each row represents a mapping of an ICD-10 code to a CCSR category. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-PCS code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The ICD-10-PCS Clinical Domain that the CCSR parent category belongs to. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.697388, "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": [{"name": "ccsr__stg_core__procedure", "package": null, "version": null}, {"name": "ccsr__procedure_category_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.ccsr__procedure_category_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_procedure_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect *, '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains only the CCSR's default category assignment for the ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6823828, "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": [{"name": "ccsr__long_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__singular_condition_category.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n ccsr_category_description,\n ccsr_parent_category,\n parent_category_description,\n body_system,\n '2023.1' as dxccsr_version,\n '2023-09-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6823828, "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": [{"name": "ccsr__dx_vertical_pivot", "package": null, "version": null}, {"name": "ccsr__long_condition_category", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6985013, "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": [{"name": "ccsr__procedure_category_map", "package": null, "version": null}, {"name": "ccsr__long_procedure_category", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that pivots the DXCCSR's wide-format mapping CSV\ninto a long format table. While the seed uses 6 columns to represent the 6 CCSR codes that\nmay be present, this generates one row for each CCSR category per ICD code, so up to\n6 rows per code. \n\nThis model includes details and descriptions of the CCSR parent category and body systems that are inherited by the final models.\n\nThis model may also be useful in looking up CCSR condition category, body system, and parent category information.\n", "columns": {"code": {"name": "code", "description": "The ICD-10-CM code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-CM code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6715968, "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": [{"name": "ccsr__dxccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "compiled": true, "compiled_code": "\n\nwith codes as (\n \n select\n icd_10_cm_code as code, \n icd_10_cm_code_description as code_description,\n -- loop to generate columns for CCSR categories 1-6\n ccsr_category_1,\n ccsr_category_1_description,\n ccsr_category_2,\n ccsr_category_2_description,\n ccsr_category_3,\n ccsr_category_3_description,\n ccsr_category_4,\n ccsr_category_4_description,\n ccsr_category_5,\n ccsr_category_5_description,\n ccsr_category_6,\n ccsr_category_6_description,\n default_ccsr_category_ip,\n default_ccsr_category_op\n from 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom long_union\n-- as not all diagnosis codes have multiple categories, we can discard nulls\nwhere ccsr_category is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that renames some PRCCSR columns to align with other TUVA models as well as the `ccsr__dx_vertical_pivot` model.", "columns": {"code": {"name": "code", "description": "The ICD-10-PCS code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-PCS code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The clinical domain to which the CCSR code belongs. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6746333, "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": [{"name": "ccsr__prccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "compiled": true, "compiled_code": "\n\nselect \n icd_10_pcs as code,\n icd_10_pcs_description as code_description,\n prccsr as ccsr_category,\n left(prccsr, 3) as ccsr_parent_category,\n prccsr_description as ccsr_category_description,\n clinical_domain,\n '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "tuva", "schema": "test", "name": "ccsr__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__condition.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__condition", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__condition"], "alias": "ccsr__stg_core__condition", "checksum": {"name": "sha256", "checksum": "58bfbd6d39695f1589b0cdb3e898932d48e10765563ac69c3489e1094b0e1a15"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6985013, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect *, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "tuva", "schema": "test", "name": "ccsr__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__procedure.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__procedure", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__procedure"], "alias": "ccsr__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "44d8ae3e59950ce973f04cc24eb71d41efb4fcd04e1ab181ffade1ef71e5b626"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6985013, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect *, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model unions condition flags from the 3 upstream stage models that calculate them.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7480955, "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": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith conditions_unioned as (\n\n select * from 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model pivots conditions on the patient level (i.e. one record per patient) with flags for each chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids": {"name": "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis": {"name": "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "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", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system": {"name": "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage": {"name": "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7322543, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient per condition using the tuva chronic conditions hierarchy as the grouper. The model pulls in the first and last date of the diagnosis that flagged the patient for this condition group.\n", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for a patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_diagnosis_date": {"name": "first_diagnosis_date", "description": "The first date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_diagnosis_date": {"name": "last_diagnosis_date", "description": "The last date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.811649, "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": [{"name": "tuva_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient with flags for all the conditions in the tuva chronic conditions hierarchy. A patient will have a 1 in the column for a certain condition if they have every been coded with a diagnosis that rolls up to that condition and a 0 if not.\n", "columns": {"patient_id": {"name": "patient_id", "description": "ID of the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.8273559, "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": [{"name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "tuva_chronic_conditions__stg_core__patient", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for all chronic conditions where additional_logic is not 'None'. This model includes standard exclusions and maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and MS DRG codes to chronic conditions.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7480955, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS). This model maps ICD-10-CM diagnosis codes and MS DRG codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7480955, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Opioid Use Disorder (OUD). This model maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and NDC codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_pharmacy_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__condition"], "alias": "cms_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "14bc859c362a0bf063c1f1b5573c4c3c579fe36fd016b68a559c9d342ad97a8a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__patient"], "alias": "cms_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "c1179facf8d0fe84d23bb48595d8788b7ea24239af870f2765aeda6b3202b689"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__procedure"], "alias": "cms_chronic_conditions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "a2edc7f43347634a329a5572d5f6d1070cb7b922b028572a264d75b6574765f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_medical_claim"], "alias": "cms_chronic_conditions__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "837370350f0cfe6af7920826ec0af6ad83b3c1e27127cfdf58e08341fcaa0257"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_pharmacy_claim"], "alias": "cms_chronic_conditions__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "31b3681bfce9e02877c6b2a296a731d66d53751cec210a6ee7367f78271c1198"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "test", "name": "tuva_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__condition"], "alias": "tuva_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "48dd1d737654e1702b462ae927368771052d05c66bd16365187e51f67470f5ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8273559, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "test", "name": "tuva_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__patient"], "alias": "tuva_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "1f922ebd0ff235d61d3cecfacf5b7fb056cf6b55b1dc14c054df6b07b38e4a0b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8273559, "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": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": "d5222aec075d58306c2d82d32978bb46ea5b2769dcf83caa0b553f5b4b3ea4bd"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.8423634, "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": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_eligibility", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "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": "53cb5eb69fc4628a336f969c3a9e59fbfdb5674b94da0e7a6f17a5101d2063d4"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns relevant encounter-level\n-- data for every professional or institutional\n-- acute inpatient claim that is part of an encounter\n-- (note that all institutional acute inpatienet claims\n-- are part of an acute inpatient encounter, but only\n-- professional acute inpatient claims that are not\n-- orphan claims and that belong to one and only\n-- one encounter, i.e. have encounter_count = 1,\n-- are part of an acute inpatient encounter).\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_id\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- *************************************************\n\n\n\n\nwith useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.admit_type_code,\n aa.admit_source_code,\n aa.discharge_disposition_code,\n aa.start_date,\n aa.end_date,\n\n bb.encounter_id,\n\n cc.encounter_start_date,\n cc.encounter_end_date\n\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "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": "2d8f929a5b5b85f848b0f60f6b32b35bb67f83f70cf9e08ebf97f10b11dd1463"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model summarizes data quality issues\n-- that could affect claims preprocessing.\n-- The table returns 2 fields:\n-- field\n-- total_count\n--\n-- If we order the results by 'field', the first\n-- 3 rows give us a high level summary:\n--\n-- 01 Total acute inpatient institutional claims:\n-- This is the total number of acute inpatient\n-- institutional claims\n-- 02 Acute inpatient institutional claims with insights:\n-- This is the number of acute inpatient institutional\n-- claims for which something is not ideal (e.g. they\n-- are missing a claim_start_date) but it's not something\n-- that prevents the claim from being used in the\n-- encounter grouper.\n\n-- 03 Acute inpatient institutional claims with problems:\n-- This is the number of acute inpatient institutional\n-- claims that have a data quality problem that\n-- prevents them from being used in the encounter grouper.\n\n-- The rest of the rows in the table give us counts\n-- of the number of acute inpatient institutional claims\n-- that have specific data quality problems.\n-- *************************************************\n\n\n\n\nwith total_acute_inpatient__institutional_claims as (\nselect\n '01 Total acute inpatient institutional claims' as field,\n count(*) as total_count\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "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": "b8d0cd8b50a6de2e907b69b4bf07ffdbe49d85231a4b9f1dbdec426a69b179a5"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8744962, "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": [{"name": "acute_inpatient__claims_with_encounter_data", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns all the columns with relevant\n-- encounter fields that we will append to the medical_claim\n-- table.\n\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- encounter_type\n-- encounter_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- orphan_claim_flag (always 0 or 1) (never null)\n-- encounter_count (could be 0,1,2,3,...) (never null)\n-- *************************************************\n\n\n\n\nwith acute_inpatient_claims_with_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' as encounter_type,\n encounter_id,\n encounter_start_date,\n encounter_end_date,\n encounter_admit_source_code,\n encounter_admit_type_code,\n encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n 0 as orphan_claim_flag,\n 1 as encounter_count\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "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": "07e04738060b76d3742ef5f62c88d54aa70e89e2cdbad424f19e61b4fab2015c"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "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": "ebf6077a6552eacde798cea20830fd9ab5af452862199f563a4081aa832ac943"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns an encounter_start_date and\n-- an encounter_end_date to each acute inpatient\n-- encounter_id.\n-- This returns a table with 4 fields:\n-- patient_id\n-- encounter_id\n-- encounter_start_date\n-- encounter_end_date\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient encounters.\n-- *************************************************\n\n\nwith add_encounter_id_to_acute_inpatient_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.8423634, "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": [{"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__stg_service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category__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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "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": "7cdfbbcf1607918ec25654f7564a75ea8a4fb364e7785c116e9c3806e29d44d4"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__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": "1265f56d7db0ed180ee11974350eee271b213b32bf4f385a9265555bfdc43327"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__stg_service_category__service_category_grouper", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category__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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "tuva", "schema": "test", "name": "acute_inpatient__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "2ff7c8bcfa4a92ed7c706b5ba9837ab9f73ace3b51ddb4a17697b0f89f532d37"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8744962, "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": [{"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "acute_inpatient__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "c830558bd8993dcb25434dc80de7850519dc42e8c6585bcc760408af37ac8b22"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9794867, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "claims_date_profiling__medical_claim_dates", "package": null, "version": null}, {"name": "claims_date_profiling__pharmacy_claim_dates", "package": null, "version": null}, {"name": "claims_date_profiling__duplicate_dates", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_duplicate_dates c\norder by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": "10104ed02e95533f702d57975058acb6ca4d6f87c1aec5c302ffb79c9ff72aea"}, "config": {"enabled": true, "alias": "_int_duplicate_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom combine\norder by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom rx_pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.9523506, "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": [{"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__medical_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_profiling__claim_type_unmapped", "package": null, "version": null}, {"name": "data_profiling__medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_profiling__institutional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__professional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_duplicates", "package": null, "version": null}, {"name": "data_profiling__eligibility_invalid_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_missing_values", "package": null, "version": null}, {"name": "data_profiling__pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__pharmacy_claim_missing_values", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.9523506, "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": [{"name": "data_profiling__test_detail_stage_medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail_stage_eligibility", "package": null, "version": null}, {"name": "data_profiling__test_detail_stage_pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_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": "3fe77291d3769dfb1debe6ff5727fe0c144b40689b3cad2bc0206c6a1ac07e48"}, "config": {"enabled": true, "alias": "test_result", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.9523506, "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": [{"name": "data_profiling__test_result_stage_medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_result_stage_eligibility", "package": null, "version": null}, {"name": "data_profiling__test_result_stage_pharmacy_claim", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.9523506, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9056318, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "9248c1c3e96379fd05b64f3e51878895d068e41ad958706f8aa6cf10ea0af3da"}, "config": {"enabled": true, "alias": "_int_eligibility_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "7e01818df529370486825af59e6a605051e95147b938062b5f97ee16c8a77758"}, "config": {"enabled": true, "alias": "_int_eligibility_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}, {"name": "terminology__gender", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__race", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__payer_type", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__medicare_dual_eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__medicare_status", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n patient_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "652f0ff0f277b997df0ea1643619960dec3925a7529f02fb7b8ececab74f9ca4"}, "config": {"enabled": true, "alias": "_int_institutional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "data_profiling__institutional_header_failures", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "c89e733d401fe7f70977ccd73c65be3e87a274ee79bdbbc1d81b5328ccf7bb61"}, "config": {"enabled": true, "alias": "_int_medical_claim_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom institutional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom professional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8895104, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "799a9cfefd8e6b72008b778dcb5af520e1c64d39c2321ef36e35a47eb0376565"}, "config": {"enabled": true, "alias": "_int_professional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "data_profiling__professional_header_failures", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "data_profiling__eligibility_duplicates", "package": null, "version": null}, {"name": "data_profiling__eligibility_missing_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_invalid_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_plausibility", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "88abe6cbdbe41510643bb0afeb061694aa386233a32b3fd24ad7dd638fb52184"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "data_profiling__institutional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__professional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_profiling__claim_type_unmapped", "package": null, "version": null}, {"name": "data_profiling__claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_profiling__medical_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__medical_claim_plausibility", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "data_profiling__pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__pharmacy_claim_missing_values", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "0584a4b85701bd2278975a8c22e89728f97a3dc07622dcafcfc38da9567618a8"}, "config": {"enabled": true, "alias": "_int_test_result_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__eligibility_denominators", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__eligibility_denominators", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__medical_claim_denominators", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__medical_claim_denominators", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "349207b0b7759006dcfd3104a4812c76e5dcc51391ec131822398a733f65d151"}, "config": {"enabled": true, "alias": "_int_test_result_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "pharmacy_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__dq_input_layer_tests", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__dq_input_layer_tests"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "compiled": true, "compiled_code": "\n\nselect\n dq_problem\n, count(distinct claim_id) as distinct_claims\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__claim_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, count(distinct service_category_2) as distinct_service_category_count\n, '2023-09-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0797164, "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": [{"name": "service_category__combined_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, claim_line_number\n, count(distinct service_category_2) as distinct_service_category_count\n, '2023-09-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "d3cfc6fe7d6bcf7f683b95ff3e6007894fd4817735c5f507120139c5d0de2696"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The second, more specific service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.9839962, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_professional", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "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": "81447058887627ad324b36a80b13b94f71cd7c19e0ced18d814ba746a29349dd"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__combined_institutional": {"database": "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": "cebd777b5aeeff5a1b6e1aafa2dff8d4c324310a5ab9426cac33ce8878feeefc"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__acute_inpatient_institutional", "package": null, "version": null}, {"name": "service_category__dialysis_institutional", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__home_health_institutional", "package": null, "version": null}, {"name": "service_category__hospice_institutional", "package": null, "version": null}, {"name": "service_category__lab_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_institutional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "93e0719b1469fa43e88e34f477b9c80351736512e0fc92c65270bf370b318a68"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__acute_inpatient_professional", "package": null, "version": null}, {"name": "service_category__ambulance_professional", "package": null, "version": null}, {"name": "service_category__ambulatory_surgery_professional", "package": null, "version": null}, {"name": "service_category__dialysis_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__emergency_department_professional", "package": null, "version": null}, {"name": "service_category__home_health_professional", "package": null, "version": null}, {"name": "service_category__hospice_professional", "package": null, "version": null}, {"name": "service_category__inpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__inpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__lab_professional", "package": null, "version": null}, {"name": "service_category__office_visit_professional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_professional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__outpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_professional", "package": null, "version": null}, {"name": "service_category__urgent_care_professional", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "03e1af6a145e9c4a6f23d31a9b882bafd00036bdd054de84f95f397db5dd5c60"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "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": "7f551f541a0021eec53a302ada51513edd1d4870c138994cfd71b684e46819b8"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dme_professional": {"database": "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": "e9fbe2c9a468a5d73b830a9da8c096cc5d12faec34c3aa3e08ecb06f4e8eda0c"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "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": "0d8d6284fb90b70bf5bd1034b4fa97081cd108f21d8d59ad22e9c8c75fb9b6c5"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "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": "bec62179109f857081e5577a6cca5825284630d210d024562c5c369f16ebb1cc"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_professional": {"database": "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": "49bc77a20cf97e54a0f83a1cea5f84928c397c7027580e2d095267e4d37614be"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "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": "b03550336364d25cfa620b4dec349cd1b544b071a9f96bc1bb61ed158a86d1cd"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_professional": {"database": "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": "a62a306193ced439567e9508b2ee6ea4c521e7907d524784c4a4c98fa13fa2db"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "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": "6fa6654b93b4504d0bb3e234076c694f6f97964a9efbc1b52aa660f3a8c9fa6f"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "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": "c98cee3648fb0e4f5c3bb7c2b1da3e20ca7e7e2eb1b0ce7be30eddf633f90082"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_institutional": {"database": "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": "b2bd57c8ed6bee3b78a52d8e4b91d497cdaadfea467133ab99a8a7f27777cc28"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_professional": {"database": "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": "db156946a2864c1e5b0d0da91e11bfca8aa2760f69a0ef228822d988dd61d724"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "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": "2ca7c96de21f1b710a6b9ba70ab983a288358848c3d9ecd9f8680f76588bd003"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "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": "271f8251c805ebfc5af31c5f6e4111d708b0eaed7ce2ec0150f564f7c1e6755a"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "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": "c2a737cf0f507a4a40c51a99081869973c4851fea6d1fc3782b01c38f5c4f542"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "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": "a592e61b8f53a343598818406ebe287bcde9e4a8f8010338609aa665f0c78bb5"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "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": "83bd3b9d1cd9992a17dde421e1931d5ddf4e9fe54bcb79cfd9a598f1a11a0993"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "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": "96702274d88d55823664b3fbcff62cdbef1f8e45a7ae67c4e780292a1929b2a1"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "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": "ea46843b3d941e271446af07da269bee8c17e7ff5fb9b86ea3dd9abc96e48760"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "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": "33996450b63c81fc536050cba2205c4840df13237e9373e2d50db4d5d167e73e"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "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": "73e8439742c3df29c376c9a1eade516ae12381fd4fb99670f2cd856ca7127d67"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "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": "5d8c59578ab9b16efdaa30071f836f31bd773750ae05c74dcb332cabd33476ea"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "service_category__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.service_category__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "staging", "service_category__stg_medical_claim"], "alias": "service_category__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "2965d28559d54346b2cd74e9da52a2f032c2cc203edaf96744344924335b1235"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model displays the contributing demographic and disease risk factors, interactions, and HCCs for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.0797164, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_factors", "package": null, "version": null}, {"name": "cms_hcc__int_enrollment_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disabled_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_count_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:02' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "raw_risk_score": {"name": "raw_risk_score", "description": "The sum of all patient risk factors.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "payment_risk_score": {"name": "payment_risk_score", "description": "The normalized risk score multiplied by the MA coding pattern adjustment factor for the corresponding HCC model version and payment years rate announcement from CMS.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.0797164, "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": [{"name": "cms_hcc__adjustment_rates", "package": null, "version": null}, {"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_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-18 09:43:02' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic and enrollment risk relative factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_members", "package": null, "version": null}, {"name": "cms_hcc__demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:00' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disabled and disease interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disabled_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:02' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factor values for every enrollee's final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:02' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factor values for final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:02' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Conditions from eligible risk-adjustable claims per claim type for the collection year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__stg_medical_claim", "package": null, "version": null}, {"name": "cms_hcc__stg_core__condition", "package": null, "version": null}, {"name": "cms_hcc__cpt_hcpcs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 09:43:01' 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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__enrollment_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:00' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Final payment-eligible HCC count factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__payment_hcc_count_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-18 09:43:02' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "HCC hierarchy for the corresponding HCC model version and payment year applied to the mapped payment-eligible HCCs.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__int_hcc_mapping", "package": null, "version": null}, {"name": "cms_hcc__disease_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "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-18 09:43:01' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Eligible conditions mapped to HCC codes for the corresponding HCC model version and payment year\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1264944, "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": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}, {"name": "cms_hcc__icd_10_cm_mappings", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "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-18 09:43:01' 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_members": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Transformed eligibility data into the demographic risk segments required for the CMS HCC and risk calculations.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1264944, "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": [{"name": "cms_hcc__stg_eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+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-18 09:42:59' 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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.1264944, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.142333, "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": [{"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.142333, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique encounter_id for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Reported date in when the condition began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date in which the condition was resolved.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.1581397, "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": [{"name": "core__stg_claims_condition", "package": null, "version": null}, {"name": "core__stg_clinical_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__condition.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_claims_condition\nunion all\nselect * from tuva.core._stg_clinical_condition\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__eligibility": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.1581397, "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": [{"name": "core__stg_claims_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__encounter": {"database": "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": "fdcb9a40f227bf4cdad6aec9e5697db02ee3e64eda31110e1a9c06a412f6185d"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code relevant to the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.1798887, "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": [{"name": "core__stg_clinical_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__lab_result": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.1798887, "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": [{"name": "core__stg_clinical_lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_clinical_lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__location": {"database": "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": "978a0da0c66bbea4fd6018afdebb6ca1dd8e3d47d0dcab69f1cc72d9356f52b9"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.1898947, "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": [{"name": "core__stg_claims_location", "package": null, "version": null}, {"name": "core__stg_clinical_location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__location.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_location\nunion all\nselect * from tuva.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medical_claim": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.206001, "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": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medication": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.206001, "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": [{"name": "core__stg_clinical_medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medication.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_clinical_medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__observation": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.206001, "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": [{"name": "core__stg_clinical_observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__observation.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_clinical_observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__patient": {"database": "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": "a66973783354be761131b8742966bf7655b486e3e75b1f1c298bec92c348f49a"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.206001, "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": [{"name": "core__stg_claims_patient", "package": null, "version": null}, {"name": "core__stg_clinical_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__patient.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_patient\nunion all\nselect * from tuva.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__pharmacy_claim": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.224983, "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": [{"name": "core__stg_claims_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__practitioner": {"database": "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": "dc5b35a5bbe081c71df40883440b3b6eb12bc8d7fead93c496176c6e50da8ac8"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.224983, "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": [{"name": "core__stg_claims_practitioner", "package": null, "version": null}, {"name": "core__stg_clinical_practitioner", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__practitioner.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_practitioner\nunion all\nselect * from tuva.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__procedure": {"database": "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": "a88b9caf3980e1ee823faa433af0c5947ef0f37507508f67b22190afbf349dd8"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.2410269, "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": [{"name": "core__stg_claims_procedure", "package": null, "version": null}, {"name": "core__stg_clinical_procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_procedure\nunion all\nselect * from tuva.core._stg_clinical_procedure\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_condition": {"database": "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": "3dc368f8772805086d66933a84c55ad1c32b012b1d271647513faadfe5a59e51"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Date in which the condition occured.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2798753, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_data_for_medical_claims", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "62b901a3441145de93eb0a160edc89cb3cf8331cd836cf580494709c3222a949"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2889764, "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": [{"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "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": "1916301fc161277fa3553c65e7e905b263fc07b18a3c1738e96ea875f521c2a6"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2566528, "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": [{"name": "acute_inpatient__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.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-18 13:42:56.047133+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_preprocessing.acute_inpatient_summary", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_location": {"database": "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": "fe01330ed0ca7c6bb2c2f968e49f98e44aad07d91ff671584e97883e78b4b143"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core patient table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.2566528, "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": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.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-18 13:42:56.047133+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "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": "5c2fc14fdc3e2972c6db2f484db5679ce219ba91f1a2f0cdff64529a8a6bd163"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.2566528, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "service_category__service_category_grouper", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "b95fb7b68d3df37c1a2463671a82a654a41aac724075ebce9e7b9877696991ca"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2727823, "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": [{"name": "eligibility", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as TIMESTAMP) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "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": "39ae6f5ba45cc246948701480a7125ab5f2d720417a81465b8de8dc18e739367"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2889764, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "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": "33427bfc35eeffea472cef0d83719227837f98bbfd8de6e16981ceb1348030f8"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "entity_type_code": {"name": "entity_type_code", "description": "Code that describes the type of provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "entity_type_description": {"name": "entity_type_description", "description": "Description of the type of provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_taxonomy_code": {"name": "primary_taxonomy_code", "description": "Code corresponding to the primary specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_specialty_description": {"name": "primary_specialty_description", "description": "Description of the primary specialty for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_name": {"name": "provider_name", "description": "Name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_organization_name": {"name": "parent_organization_name", "description": "Name of the parent organization for the provider.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "practice_city": {"name": "practice_city", "description": "The city where the provider is located.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_state": {"name": "practice_state", "description": "The state where the provider is located.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_zip_code": {"name": "practice_zip_code", "description": "The zip code for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_updated": {"name": "last_updated", "description": "Date when the data for this provider was last updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deactivation_date": {"name": "deactivation_date", "description": "Date when this NPI was deactivated if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deactivation_flag": {"name": "deactivation_flag", "description": "Flag indicating if this NPI was deactivated.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.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-18 13:42:56.047133+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "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": "b687769a37ae3cce332211c16cf2635665b1b4c16ba5ef556704da0c7b09c56f"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "Type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.2798753, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "acute_inpatient__encounter_data_for_medical_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_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.test.lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_location": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.location", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "practitioner", "package": null, "version": null}], "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.test.practitioner", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__claim_categorization": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__claim_categorization", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\data_quality\\ed_classification__claim_categorization.sql", "original_file_path": "models\\ed_classification\\data_quality\\ed_classification__claim_categorization.sql", "unique_id": "model.the_tuva_project.ed_classification__claim_categorization", "fqn": ["the_tuva_project", "ed_classification", "data_quality", "ed_classification__claim_categorization"], "alias": "_int_claim_categorization", "checksum": {"name": "sha256", "checksum": "4f7f52b9325a2aa150f6d3a2731a68448059c6f13fbd78f5e3cb9c17c249282f"}, "config": {"enabled": true, "alias": "_int_claim_categorization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "For all condition rows associated with ED claims, perform a crosstab against\nthe service category to double check that they really are mostly outpatient ED claims.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_claim_categorization", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3848827, "relation_name": "tuva.ed_classification._int_claim_categorization", "raw_code": "/*\r\nHighlights any lack of alignment between the ED records being used\r\nfor ED classification and the service category fields.\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n service_category_1\r\n , service_category_2\r\n , count(*) as condition_count\r\n\r\nfrom {{ ref('ed_classification__int_condition_with_claim') }}\r\ngroup by service_category_1, service_category_2\r\norder by count(*) desc", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\data_quality\\ed_classification__claim_categorization.sql", "compiled": true, "compiled_code": "/*\nHighlights any lack of alignment between the ED records being used\nfor ED classification and the service category fields.\n*/\n\n\n\nselect\n service_category_1\n , service_category_2\n , count(*) as condition_count\n\nfrom tuva.ed_classification._int_condition_with_claim\ngroup by service_category_1, service_category_2\norder by count(*) desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__unclassified_conditions": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__unclassified_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\data_quality\\ed_classification__unclassified_conditions.sql", "original_file_path": "models\\ed_classification\\data_quality\\ed_classification__unclassified_conditions.sql", "unique_id": "model.the_tuva_project.ed_classification__unclassified_conditions", "fqn": ["the_tuva_project", "ed_classification", "data_quality", "ed_classification__unclassified_conditions"], "alias": "_int_unclassified_conditions", "checksum": {"name": "sha256", "checksum": "8b4eb15e8565d90b3892360b2eb59febcb572e96e16fe223c3036b8b8c4ed89a"}, "config": {"enabled": true, "alias": "_int_unclassified_conditions", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "CCS Level Breakdown of the conditions table augmented with the probabilistic\nclassification flags. Includes statistics about the codes and conditions\nthat could not be classified using the ED Classification algorithm.\n", "columns": {"ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "CCS Description for the ICD code in the discharge diagnosis of the conditions table augmented with COVID.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unique_codes_in_ccs_count": {"name": "unique_codes_in_ccs_count", "description": "Number of unique condition codes that fit into the CCS descrption", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unique_unclassified_codes_in_ccs_count": {"name": "unique_unclassified_codes_in_ccs_count", "description": "Number of the condition diagnoses in the CCS description", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_row_unclassified_percent": {"name": "condition_row_unclassified_percent", "description": "Percent of the discharge diagnosis condition rows that were not classifiable using the ED Classification algorithm. I.e. the rows with diagnosis codes that weren't assigned a ED classification probability, either because the code didn't exist the time the algorithm was created or something else.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unclassified_claim_paid_amount_sum": {"name": "unclassified_claim_paid_amount_sum", "description": "Total spend associated with unclassified ED claims", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_unclassified_conditions", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3848827, "relation_name": "tuva.ed_classification._int_unclassified_conditions", "raw_code": "/*\r\nCCS Level breakdown of condition diagnoses and statistics\r\non the number of codes and condition rows that could not\r\nbe classified using the johnston algorithm\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n ccs_description_with_covid\r\n , count(distinct(code)) as unique_codes_in_ccs_count\r\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\r\n , count(code) as condition_row_count\r\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\r\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\r\n\r\nfrom {{ ref('ed_classification__int_merge_condition') }}\r\ngroup by ccs_description_with_covid\r\norder by unclassified_claim_paid_amount_sum desc", "language": "sql", "refs": [{"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\data_quality\\ed_classification__unclassified_conditions.sql", "compiled": true, "compiled_code": "/*\nCCS Level breakdown of condition diagnoses and statistics\non the number of codes and condition rows that could not\nbe classified using the johnston algorithm\n*/\n\n\n\nselect\n ccs_description_with_covid\n , count(distinct(code)) as unique_codes_in_ccs_count\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\n , count(code) as condition_row_count\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\n\nfrom tuva.ed_classification._int_merge_condition\ngroup by ccs_description_with_covid\norder by unclassified_claim_paid_amount_sum desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__unclassified_rows": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__unclassified_rows", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\data_quality\\ed_classification__unclassified_rows.sql", "original_file_path": "models\\ed_classification\\data_quality\\ed_classification__unclassified_rows.sql", "unique_id": "model.the_tuva_project.ed_classification__unclassified_rows", "fqn": ["the_tuva_project", "ed_classification", "data_quality", "ed_classification__unclassified_rows"], "alias": "_int_unclassified_rows", "checksum": {"name": "sha256", "checksum": "d2f594c40bf8832f99b737396cb85244a03fdfad9d5f782ffc075906a6fc17a8"}, "config": {"enabled": true, "alias": "_int_unclassified_rows", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Overall unclassified rows stats.", "columns": {"condition_row_unclassified_percent": {"name": "condition_row_unclassified_percent", "description": "Percent of discharge condition rows that were not classifiable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_unclassified_rows", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3848827, "relation_name": "tuva.ed_classification._int_unclassified_rows", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n cast({{ date_part(\"year\", \"recorded_date\") }} as {{ dbt.type_string() }}) as recorded_date_year\r\n , count(distinct(code)) as unique_codes_in_ccs_count\r\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\r\n , count(code) as condition_row_count\r\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\r\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\r\n\r\nfrom {{ ref('ed_classification__int_merge_condition') }}\r\ngroup by recorded_date_year\r\norder by unclassified_claim_paid_amount_sum desc", "language": "sql", "refs": [{"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\data_quality\\ed_classification__unclassified_rows.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(date_part('year', recorded_date) as TEXT) as recorded_date_year\n , count(distinct(code)) as unique_codes_in_ccs_count\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\n , count(code) as condition_row_count\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\n\nfrom tuva.ed_classification._int_merge_condition\ngroup by recorded_date_year\norder by unclassified_claim_paid_amount_sum desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__summary": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\final\\ed_classification__summary.sql", "original_file_path": "models\\ed_classification\\final\\ed_classification__summary.sql", "unique_id": "model.the_tuva_project.ed_classification__summary", "fqn": ["the_tuva_project", "ed_classification", "final", "ed_classification__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "00f47f14c7d48c7aa6e68a03b36bb32fe8555cd1abd9a6e9ce0242cd208107f5"}, "config": {"enabled": true, "alias": "summary", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED Classification as a cube that can be summarized\n", "columns": {"classification": {"name": "classification", "description": "ED classification categories", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifer for each claim", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date on which the condition was recorded", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The normalized condition code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "The normalized description of the condition code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "The condition category with covid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date_year": {"name": "recorded_date_year", "description": "The year of the condition recorded date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date_year_month": {"name": "recorded_date_year_month", "description": "The year and month of the condition recorded date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "The sum of the claim paid amount lines", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category the claim belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category the claim belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_parent_organization_name_with_provider_name": {"name": "provider_parent_organization_name_with_provider_name", "description": "The parent organization and provider name associate with the claim", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The provider first name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The provider last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_organization_name": {"name": "provider_organization_name", "description": "The provider organization", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_practice_state": {"name": "provider_practice_state", "description": "The provider practice state", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_practice_zip_code": {"name": "provider_practice_zip_code", "description": "The provider practice zip code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_gender": {"name": "patient_gender", "description": "The patient gender", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_birth_date": {"name": "patient_birth_date", "description": "The patient date of birth", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The patient age as of now", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "The patient race", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_state": {"name": "patient_state", "description": "The patient state", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "Human readable name of the classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "The order of the classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_column": {"name": "classification_column", "description": "A short hand name of the classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "summary", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3364599, "relation_name": "tuva.ed_classification.summary", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n *\r\nfrom {{ ref('ed_classification__int_condition_with_claim') }}\r\ninner join {{ ref('ed_classification__categories') }} using(classification)", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}, {"name": "ed_classification__categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "seed.the_tuva_project.ed_classification__categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\final\\ed_classification__summary.sql", "compiled": true, "compiled_code": "\n\nselect\n *\nfrom tuva.ed_classification._int_condition_with_claim\ninner join tuva.ed_classification._value_set_categories using(classification)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_ccs_description": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_ccs_description", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_ccs_description.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_ccs_description.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_ccs_description", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_ccs_description"], "alias": "_int_by_ccs_description", "checksum": {"name": "sha256", "checksum": "400b72e1aa00aa51d05f39d313207b694c2ffcae4f366839ddf2aaf6c52dc27b"}, "config": {"enabled": true, "alias": "_int_by_ccs_description", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_ccs_description", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3364599, "relation_name": "tuva.ed_classification._int_by_ccs_description", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , ccs_description_with_covid\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, ccs_description_with_covid\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\n\r\nselect\r\n summary.*\r\n ,claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_ccs_description.sql", "compiled": true, "compiled_code": "\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , ccs_description_with_covid\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, ccs_description_with_covid\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\n\nselect\n summary.*\n ,claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_patient_race": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_patient_race", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_patient_race.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_patient_race.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_patient_race", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_patient_race"], "alias": "_int_by_patient_race", "checksum": {"name": "sha256", "checksum": "62fe3c2df18b4c9b47fa9f05cde3fab19befe0166a3a9236975f63c43618f6eb"}, "config": {"enabled": true, "alias": "_int_by_patient_race", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_patient_race", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3364599, "relation_name": "tuva.ed_classification._int_by_patient_race", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , patient_race\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, patient_race\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\n\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_patient_race.sql", "compiled": true, "compiled_code": "\n\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , patient_race\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, patient_race\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\n\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_provider_parent_organization": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_provider_parent_organization", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_provider_parent_organization.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_provider_parent_organization.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_parent_organization", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_provider_parent_organization"], "alias": "_int_by_provider_parent_organization", "checksum": {"name": "sha256", "checksum": "7c9f8d53ee9872970f5e91336757e0b2f7580580fe259585c4d8dac95fe5fc11"}, "config": {"enabled": true, "alias": "_int_by_provider_parent_organization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_parent_organization_with_provider_name": {"name": "provider_parent_organization_with_provider_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_provider_parent_organization", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_provider_parent_organization", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , provider_parent_organization_name_with_provider_name\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, provider_parent_organization_name_with_provider_name\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_provider_parent_organization.sql", "compiled": true, "compiled_code": "\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , provider_parent_organization_name_with_provider_name\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, provider_parent_organization_name_with_provider_name\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_provider_practice_state": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_provider_practice_state", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_provider_practice_state.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_provider_practice_state.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_practice_state", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_provider_practice_state"], "alias": "_int_by_provider_practice_state", "checksum": {"name": "sha256", "checksum": "6e5cf37a80527f9722c5178ce51fe5f1f431f9064a96e8f059a0ae8c9a5df071"}, "config": {"enabled": true, "alias": "_int_by_provider_practice_state", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_practice_state": {"name": "provider_practice_state", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_provider_practice_state", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_provider_practice_state", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , provider_practice_state\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, provider_practice_state\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_provider_practice_state.sql", "compiled": true, "compiled_code": "\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , provider_practice_state\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, provider_practice_state\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_year": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_year", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_year.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_year.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_year", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_year"], "alias": "_int_by_year", "checksum": {"name": "sha256", "checksum": "82f7535173f1c48130b8b43e563698b5711272c883c2a4897baf9bbe711ef4e7"}, "config": {"enabled": true, "alias": "_int_by_year", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_year", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_year", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\nfrom {{ ref('ed_classification__summary') }}\r\ngroup by classification_order, classification_name, recorded_date_year\r\norder by recorded_date_year, classification_order", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_year.sql", "compiled": true, "compiled_code": "\n\nselect\n classification_order\n , classification_name\n , recorded_date_year\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\nfrom tuva.ed_classification.summary\ngroup by classification_order, classification_name, recorded_date_year\norder by recorded_date_year, classification_order", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_year_month": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_year_month", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_year_month.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_year_month.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_year_month", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_year_month"], "alias": "_int_by_year_month", "checksum": {"name": "sha256", "checksum": "3e92e01f247b8ae5c5649c30956558748543a6a3eb82fc54384c4591d052e066"}, "config": {"enabled": true, "alias": "_int_by_year_month", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year month", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year_month": {"name": "condition_date_year_month", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_year_month", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_year_month", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , recorded_date_year_month\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, recorded_date_year_month\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by classification_order, recorded_date_year_month desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_year_month.sql", "compiled": true, "compiled_code": "\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , recorded_date_year_month\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, recorded_date_year_month\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by classification_order, recorded_date_year_month desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_condition_with_claim": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_condition_with_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_condition_with_claim.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_condition_with_claim.sql", "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_claim", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_condition_with_claim"], "alias": "_int_condition_with_claim", "checksum": {"name": "sha256", "checksum": "615a40ee5eecd7bc88417550d053cce47443ae5a45d6760e8c7151ce0c900ece"}, "config": {"enabled": true, "alias": "_int_condition_with_claim", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filtered condition row table to classified ones. Includes additional\ninformation from the claim header, provider and patient tables\n", "columns": {"claim_id": {"name": "claim_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_condition_with_claim", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_condition_with_claim", "raw_code": "/*\r\nDenormalized view of each condition row with additional provider and patient level\r\ninformation merged on based on the header level detail on the claim\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith deduped_claims as (\r\n select distinct\r\n claim_id\r\n , claim_line_end_date\r\n , service_category_1\r\n , service_category_2\r\n , facility_npi\r\n , billing_npi\r\n , patient_id\r\n from {{ ref('ed_classification__stg_medical_claim') }} mc\r\n where mc.claim_line_number = 1\r\n)\r\n, deduped_providers as (\r\n select distinct\r\n npi\r\n , entity_type_code\r\n , entity_type_description\r\n , primary_taxonomy_code\r\n , primary_specialty_description\r\n , provider_first_name\r\n , provider_last_name\r\n , provider_organization_name\r\n , parent_organization_name\r\n , practice_city\r\n , practice_state\r\n , practice_zip_code\r\n from {{ ref('terminology__provider') }}\r\n)\r\n\r\nselect\r\n c.claim_id\r\n , c.patient_id\r\n , c.recorded_date\r\n , c.code\r\n , c.description\r\n , c.ccs_description_with_covid\r\n , c.recorded_date_year\r\n , c.recorded_date_year_month\r\n , c.claim_paid_amount_sum\r\n , c.classification\r\n -- claim level additions\r\n , mc.service_category_1\r\n , mc.service_category_2\r\n -- provider level additions\r\n , coalesce(fp.parent_organization_name\r\n , bp.parent_organization_name\r\n , fp.provider_first_name||' '||fp.provider_last_name\r\n , bp.provider_first_name||' '||bp.provider_last_name\r\n , fp.provider_organization_name\r\n , bp.provider_organization_name) as provider_parent_organization_name_with_provider_name\r\n , coalesce(fp.provider_first_name, bp.provider_first_name) as provider_first_name\r\n , coalesce(fp.provider_last_name, bp.provider_last_name) as provider_last_name\r\n , coalesce(fp.provider_organization_name, bp.provider_organization_name) as provider_organization_name\r\n , coalesce(fp.parent_organization_name, bp.parent_organization_name) as provider_parent_organization_name\r\n , coalesce(fp.practice_state, bp.practice_state) as provider_practice_state\r\n , coalesce(fp.practice_zip_code, bp.practice_zip_code) as provider_practice_zip_code\r\n -- patient level additions\r\n , p.sex as patient_gender\r\n , p.birth_date as patient_birth_date\r\n , floor({{ datediff('birth_date', 'current_date', 'hour') }} / 8766.0) as patient_age\r\n , p.race as patient_race\r\n , p.state as patient_state\r\n\r\nfrom {{ ref('ed_classification__int_condition_with_class') }} c\r\ninner join deduped_claims mc\r\n on c.claim_id = mc.claim_id\r\n and c.recorded_date = mc.claim_line_end_date\r\nleft join deduped_providers fp on mc.facility_npi = fp.npi\r\nleft join deduped_providers bp on mc.billing_npi = bp.npi\r\nleft join {{ ref('ed_classification__stg_patient') }} p on mc.patient_id = p.patient_id", "language": "sql", "refs": [{"name": "ed_classification__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "ed_classification__int_condition_with_class", "package": null, "version": null}, {"name": "ed_classification__stg_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ed_classification__stg_medical_claim", "seed.the_tuva_project.terminology__provider", "model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_condition_with_claim.sql", "compiled": true, "compiled_code": "/*\nDenormalized view of each condition row with additional provider and patient level\ninformation merged on based on the header level detail on the claim\n*/\n\n\n\nwith __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n), __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n),deduped_claims as (\n select distinct\n claim_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , facility_npi\n , billing_npi\n , patient_id\n from __dbt__cte__ed_classification__stg_medical_claim mc\n where mc.claim_line_number = 1\n)\n, deduped_providers as (\n select distinct\n npi\n , entity_type_code\n , entity_type_description\n , primary_taxonomy_code\n , primary_specialty_description\n , provider_first_name\n , provider_last_name\n , provider_organization_name\n , parent_organization_name\n , practice_city\n , practice_state\n , practice_zip_code\n from tuva.terminology.provider\n)\n\nselect\n c.claim_id\n , c.patient_id\n , c.recorded_date\n , c.code\n , c.description\n , c.ccs_description_with_covid\n , c.recorded_date_year\n , c.recorded_date_year_month\n , c.claim_paid_amount_sum\n , c.classification\n -- claim level additions\n , mc.service_category_1\n , mc.service_category_2\n -- provider level additions\n , coalesce(fp.parent_organization_name\n , bp.parent_organization_name\n , fp.provider_first_name||' '||fp.provider_last_name\n , bp.provider_first_name||' '||bp.provider_last_name\n , fp.provider_organization_name\n , bp.provider_organization_name) as provider_parent_organization_name_with_provider_name\n , coalesce(fp.provider_first_name, bp.provider_first_name) as provider_first_name\n , coalesce(fp.provider_last_name, bp.provider_last_name) as provider_last_name\n , coalesce(fp.provider_organization_name, bp.provider_organization_name) as provider_organization_name\n , coalesce(fp.parent_organization_name, bp.parent_organization_name) as provider_parent_organization_name\n , coalesce(fp.practice_state, bp.practice_state) as provider_practice_state\n , coalesce(fp.practice_zip_code, bp.practice_zip_code) as provider_practice_zip_code\n -- patient level additions\n , p.sex as patient_gender\n , p.birth_date as patient_birth_date\n , floor(datediff(\n hour,\n birth_date,\n current_date\n ) / 8766.0) as patient_age\n , p.race as patient_race\n , p.state as patient_state\n\nfrom tuva.ed_classification._int_condition_with_class c\ninner join deduped_claims mc\n on c.claim_id = mc.claim_id\n and c.recorded_date = mc.claim_line_end_date\nleft join deduped_providers fp on mc.facility_npi = fp.npi\nleft join deduped_providers bp on mc.billing_npi = bp.npi\nleft join __dbt__cte__ed_classification__stg_patient p on mc.patient_id = p.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_medical_claim", "sql": " __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n)"}, {"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_condition_with_class": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_condition_with_class", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_condition_with_class.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_condition_with_class.sql", "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_class", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_condition_with_class"], "alias": "_int_condition_with_class", "checksum": {"name": "sha256", "checksum": "f87662ccd62983cf740426e24fa5f43b6a263d8dad5870ed1de752c285821aa6"}, "config": {"enabled": true, "alias": "_int_condition_with_class", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filtered condition row table to classified ones.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_condition_with_class", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_condition_with_class", "raw_code": "/*\r\nFilter conditions to those that were classified and pick the classification\r\nwith the greatest probability (that's the greatest logic). This logic removes\r\nany rows that were not classified.\r\n*/\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n a.encounter_id\r\n , a.claim_id\r\n , a.patient_id\r\n , a.code_type\r\n , a.code\r\n , a.description\r\n , a.ccs_description_with_covid\r\n , a.recorded_date\r\n , cast({{ date_part(\"year\", \"recorded_date\") }} as {{ dbt.type_string() }}) as recorded_date_year\r\n , cast({{ date_part(\"year\", \"recorded_date\") }} as {{ dbt.type_string() }})\r\n || lpad(cast({{ date_part(\"month\", \"recorded_date\") }} as {{ dbt.type_string() }}), 2, '0')\r\n as recorded_date_year_month\r\n , a.claim_paid_amount_sum\r\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\r\n when edcnnpa then 'edcnnpa'\r\n when edcnpa then 'edcnpa'\r\n when epct then 'epct'\r\n when noner then 'noner'\r\n when injury then 'injury'\r\n when psych then 'psych'\r\n when alcohol then 'alcohol'\r\n when drug then 'drug'\r\n else 'unclassified'\r\n end as classification\r\nfrom {{ ref('ed_classification__int_merge_condition') }} a\r\nwhere ed_classification_capture = 1", "language": "sql", "refs": [{"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_condition_with_class.sql", "compiled": true, "compiled_code": "/*\nFilter conditions to those that were classified and pick the classification\nwith the greatest probability (that's the greatest logic). This logic removes\nany rows that were not classified.\n*/\n\n\nselect\n a.encounter_id\n , a.claim_id\n , a.patient_id\n , a.code_type\n , a.code\n , a.description\n , a.ccs_description_with_covid\n , a.recorded_date\n , cast(date_part('year', recorded_date) as TEXT) as recorded_date_year\n , cast(date_part('year', recorded_date) as TEXT)\n || lpad(cast(date_part('month', recorded_date) as TEXT), 2, '0')\n as recorded_date_year_month\n , a.claim_paid_amount_sum\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\n when edcnnpa then 'edcnnpa'\n when edcnpa then 'edcnpa'\n when epct then 'epct'\n when noner then 'noner'\n when injury then 'injury'\n when psych then 'psych'\n when alcohol then 'alcohol'\n when drug then 'drug'\n else 'unclassified'\n end as classification\nfrom tuva.ed_classification._int_merge_condition a\nwhere ed_classification_capture = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_merge_condition": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_merge_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_merge_condition.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_merge_condition.sql", "unique_id": "model.the_tuva_project.ed_classification__int_merge_condition", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_merge_condition"], "alias": "_int_merge_condition", "checksum": {"name": "sha256", "checksum": "579e75decf752826252bce468fc0b2df6be15f8e5eefa50ea84f4e07db7dbdf2"}, "config": {"enabled": true, "alias": "_int_merge_condition", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "All conditions with the classifications merged on and resolved to a single\ncategory per condition row.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_merge_condition", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_merge_condition", "raw_code": "/*\r\nAll condition discharge diagnosis left join with probabilistic\r\nindicators of ED classification terminology\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n{% set colnames = [\"edcnnpa\", \"edcnpa\", \"epct\", \"noner\", \"injury\", \"psych\", \"alcohol\", \"drug\"] %}\r\n\r\nwith condition as (\r\nselect * from {{ ref('ed_classification__int_primary_dx_per_claim') }}\r\n)\r\n, icd9 as (\r\n select\r\n icd9 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd9') }}\r\n)\r\n, icd10 as (\r\n select\r\n icd10 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd10') }}\r\n)\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd10.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\r\nfrom condition a\r\nleft join icd10\r\non a.code = icd10.code and a.code_type = 'icd-10-cm'\r\nunion all\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd9.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\r\nfrom condition a\r\ninner join icd9\r\non a.code = icd9.code and a.code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "ed_classification__int_primary_dx_per_claim", "package": null, "version": null}, {"name": "ed_classification__johnston_icd9", "package": null, "version": null}, {"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim", "seed.the_tuva_project.ed_classification__johnston_icd9", "seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_merge_condition.sql", "compiled": true, "compiled_code": "/*\nAll condition discharge diagnosis left join with probabilistic\nindicators of ED classification terminology\n*/\n\n\n\n\nwith condition as (\nselect * from tuva.ed_classification._int_primary_dx_per_claim\n)\n, icd9 as (\n select\n icd9 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from tuva.ed_classification._value_set_johnston_icd9\n)\n, icd10 as (\n select\n icd10 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from tuva.ed_classification._value_set_johnston_icd10\n)\n\nselect\n a.*\n \n , icd10.edcnnpa\n \n , icd10.edcnpa\n \n , icd10.epct\n \n , icd10.noner\n \n , icd10.injury\n \n , icd10.psych\n \n , icd10.alcohol\n \n , icd10.drug\n \n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\nfrom condition a\nleft join icd10\non a.code = icd10.code and a.code_type = 'icd-10-cm'\nunion all\nselect\n a.*\n \n , icd9.edcnnpa\n \n , icd9.edcnpa\n \n , icd9.epct\n \n , icd9.noner\n \n , icd9.injury\n \n , icd9.psych\n \n , icd9.alcohol\n \n , icd9.drug\n \n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\nfrom condition a\ninner join icd9\non a.code = icd9.code and a.code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_patient_list": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_patient_list", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_patient_list.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_patient_list.sql", "unique_id": "model.the_tuva_project.ed_classification__int_patient_list", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_patient_list"], "alias": "_int_patient_list", "checksum": {"name": "sha256", "checksum": "d31576b976fcccb7ca171c09ccf6767c4c2f612d37877d69d48d1d704ef50677"}, "config": {"enabled": true, "alias": "_int_patient_list", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED condition rows with all available patient information joined in.\nUseful for identifying patients who have more than a certain number\nof ED visits per time period.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_patient_list", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_patient_list", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nselect\r\n p.*\r\n , c.claim_id\r\n , c.recorded_date\r\n , c.recorded_date_year\r\n , c.recorded_date_year_month\r\n , c.code_type\r\n , c.code\r\n , c.description\r\n , c.ccs_description_with_covid\r\n , ec.classification_order\r\n , c.classification\r\n , ec.classification_name\r\nfrom {{ ref('ed_classification__int_condition_with_class') }} c\r\ninner join {{ ref('ed_classification__stg_patient') }} p using(patient_id)\r\ninner join {{ ref('ed_classification__categories') }} ec using(classification)", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_class", "package": null, "version": null}, {"name": "ed_classification__stg_patient", "package": null, "version": null}, {"name": "ed_classification__categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_patient_list.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n)select\n p.*\n , c.claim_id\n , c.recorded_date\n , c.recorded_date_year\n , c.recorded_date_year_month\n , c.code_type\n , c.code\n , c.description\n , c.ccs_description_with_covid\n , ec.classification_order\n , c.classification\n , ec.classification_name\nfrom tuva.ed_classification._int_condition_with_class c\ninner join __dbt__cte__ed_classification__stg_patient p using(patient_id)\ninner join tuva.ed_classification._value_set_categories ec using(classification)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_primary_dx_per_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_primary_dx_per_claim.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_primary_dx_per_claim.sql", "unique_id": "model.the_tuva_project.ed_classification__int_primary_dx_per_claim", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_primary_dx_per_claim"], "alias": "_int_primary_dx_per_claim", "checksum": {"name": "sha256", "checksum": "1aef126a28d5eb4eee9e4ea5c8db8fbe8e459abdb188ee430f0607af0c53bee8"}, "config": {"enabled": true, "alias": "_int_primary_dx_per_claim", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED condition rows with all available patient information joined in.\nUseful for identifying patients who have more than a certain number\nof ED visits per time period.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_primary_dx_per_claim", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3798127, "relation_name": "tuva.ed_classification._int_primary_dx_per_claim", "raw_code": "/*\r\nStaging model for the input layer:\r\nThis contains one row for every unique primary discharge diagnosis in the dataset.\r\nThis is also filtered to ED claims.\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith ed_claims as (\r\n select\r\n claim_id\r\n , sum(med.paid_amount) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__stg_medical_claim') }} med\r\n left join {{ ref('ed_classification__stg_encounter') }} enc\r\n on med.encounter_id = enc.encounter_id\r\n where (place_of_service_code = '23' or revenue_center_code in ('0450', '0451', '0452', '0456', '0459', '0981'))\r\n and (encounter_type <> 'acute inpatient' or encounter_type is null)\r\n group by claim_id\r\n)\r\n\r\nselect\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 , cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(normalized_code_type as {{ dbt.type_string() }}) as code_type\r\n , cast(normalized_code as {{ dbt.type_string() }}) as code\r\n , cast(condition.normalized_description as {{ dbt.type_string() }}) as description\r\n , cast(case\r\n when lower(condition.normalized_description) like '%covid%'\r\n then condition.normalized_description\r\n else mapping.ccs_description\r\n end\r\n as {{ dbt.type_string() }}) as ccs_description_with_covid\r\n , recorded_date\r\n , cast(claim_paid_amount_sum as {{ dbt.type_float() }}) as claim_paid_amount_sum\r\nfrom {{ ref('ed_classification__stg_condition') }} condition\r\ninner join ed_claims using(claim_id)\r\nleft join {{ ref('ed_classification__icd_10_cm_to_ccs') }} mapping \r\non condition.normalized_code = mapping.icd_10_cm\r\nwhere condition_rank = 1", "language": "sql", "refs": [{"name": "ed_classification__stg_medical_claim", "package": null, "version": null}, {"name": "ed_classification__stg_encounter", "package": null, "version": null}, {"name": "ed_classification__stg_condition", "package": null, "version": null}, {"name": "ed_classification__icd_10_cm_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float"], "nodes": ["model.the_tuva_project.ed_classification__stg_medical_claim", "model.the_tuva_project.ed_classification__stg_encounter", "model.the_tuva_project.ed_classification__stg_condition", "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_primary_dx_per_claim.sql", "compiled": true, "compiled_code": "/*\nStaging model for the input layer:\nThis contains one row for every unique primary discharge diagnosis in the dataset.\nThis is also filtered to ED claims.\n*/\n\n\n\nwith __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n), __dbt__cte__ed_classification__stg_encounter as (\nselect\n encounter_id\n , encounter_type\nfrom tuva.core.encounter\n),ed_claims as (\n select\n claim_id\n , sum(med.paid_amount) as claim_paid_amount_sum\n from __dbt__cte__ed_classification__stg_medical_claim med\n left join __dbt__cte__ed_classification__stg_encounter enc\n on med.encounter_id = enc.encounter_id\n where (place_of_service_code = '23' or revenue_center_code in ('0450', '0451', '0452', '0456', '0459', '0981'))\n and (encounter_type <> 'acute inpatient' or encounter_type is null)\n group by claim_id\n)\n\nselect\n cast(encounter_id as TEXT) as encounter_id\n , cast(claim_id as TEXT) as claim_id\n , cast(patient_id as TEXT) as patient_id\n , cast(normalized_code_type as TEXT) as code_type\n , cast(normalized_code as TEXT) as code\n , cast(condition.normalized_description as TEXT) as description\n , cast(case\n when lower(condition.normalized_description) like '%covid%'\n then condition.normalized_description\n else mapping.ccs_description\n end\n as TEXT) as ccs_description_with_covid\n , recorded_date\n , cast(claim_paid_amount_sum as FLOAT) as claim_paid_amount_sum\nfrom tuva.ed_classification.ed_classification__stg_condition condition\ninner join ed_claims using(claim_id)\nleft join tuva.ed_classification._value_set_icd_10_cm_to_ccs mapping \non condition.normalized_code = mapping.icd_10_cm\nwhere condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_medical_claim", "sql": " __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n)"}, {"id": "model.the_tuva_project.ed_classification__stg_encounter", "sql": " __dbt__cte__ed_classification__stg_encounter as (\nselect\n encounter_id\n , encounter_type\nfrom tuva.core.encounter\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_condition": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_condition.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_condition.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_condition", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_condition"], "alias": "ed_classification__stg_condition", "checksum": {"name": "sha256", "checksum": "3428386bd4e6edb1dee81ab1c9e4220ba526e07575737cd11b5f2ef1e5031427"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "bind": false}, "created_at": 1695044213.3798127, "relation_name": "tuva.ed_classification.ed_classification__stg_condition", "raw_code": "select\r\n claim_id\r\n , patient_id\r\n , encounter_id\r\n , recorded_date\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , condition_rank\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_condition.sql", "compiled": true, "compiled_code": "select\n claim_id\n , patient_id\n , encounter_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , normalized_description\n , condition_rank\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_encounter": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_encounter.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_encounter", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_encounter"], "alias": "ed_classification__stg_encounter", "checksum": {"name": "sha256", "checksum": "c3a5b8ec4d92bcfda383280fca59c983ac34ac0820d84badb369f3419b1aa160"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "bind": false}, "created_at": 1695044213.3848827, "relation_name": null, "raw_code": "select\r\n encounter_id\r\n , encounter_type\r\nfrom {{ ref('core__encounter') }}", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "compiled": true, "compiled_code": "select\n encounter_id\n , encounter_type\nfrom tuva.core.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_medical_claim": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_medical_claim.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_medical_claim", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_medical_claim"], "alias": "ed_classification__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "e67609ef6e42286545130b97c8a50692adee47894356dde99ac9f19cf98b85fe"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "bind": false}, "created_at": 1695044213.3848827, "relation_name": null, "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , encounter_id\r\n , patient_id\r\n , claim_line_end_date\r\n , service_category_1\r\n , service_category_2\r\n , place_of_service_code\r\n , revenue_center_code\r\n , billing_npi\r\n , facility_npi\r\n , paid_amount\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_medical_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_patient": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_patient.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_patient", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_patient"], "alias": "ed_classification__stg_patient", "checksum": {"name": "sha256", "checksum": "923260a6034fff8dfe2880e7b6bdb39545c838b1a64aab3bb1895651179aff40"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "bind": false}, "created_at": 1695044213.3848827, "relation_name": null, "raw_code": "select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , race\r\n , state\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "compiled": true, "compiled_code": "select\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "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": "1c0fc013f1dc56626c276f1ab29b0ff9a5ee4a6a24220a18d0d43e3db0e6827e"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Creates member months from eligibility data", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "The payer covering the patient's eligibility", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4311867, "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": [{"name": "terminology__calendar", "package": null, "version": null}, {"name": "financial_pmpm__stg_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__stg_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4475298, "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": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm.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-18 13:42:56.047133+00:00' as tuva_last_run\nFROM tuva.financial_pmpm.pmpm_prep a\nGROUP BY 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes all the paid and allowed statistics for every patient_id and year_month combination. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4475298, "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": [{"name": "financial_pmpm__stg_member_months", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_allowed_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_allowed_pivot", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Adds service categories to claims and sums paid and allowed amounts to the year-month level.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__stg_medical_claim", "package": null, "version": null}, {"name": "financial_pmpm__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "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": "c2f75358acd58cf147e0d3be427ac89d48b8e856fe97a99d7c40c8c351b0d2d3"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "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": "a0db911502a08ce6bbb832549d4b5e55f9859c2e0698dcf6bea107b8c7054640"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "tuva", "schema": "test", "name": "financial_pmpm__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_eligibility"], "alias": "financial_pmpm__stg_eligibility", "checksum": {"name": "sha256", "checksum": "bca6a11194db8df07465f3d4659e15c19c359607a83c4456ccb19a12b3003ee0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "core__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "financial_pmpm__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_medical_claim"], "alias": "financial_pmpm__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "c388768c61e03729cddff1584573bef76c239a66824250b2c82fc21ca646ca88"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, claim_id\n, claim_line_number\n, claim_start_date\n, claim_end_date\n, service_category_1\n, service_category_2\n, paid_amount\n, allowed_amount\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_member_months": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "financial_pmpm__member_months", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "tuva", "schema": "test", "name": "financial_pmpm__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_pharmacy_claim"], "alias": "financial_pmpm__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "30a2cc87ca3fe2978c95d27531c380940217b319465b4a4e003a2fc137445351"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, dispensing_date\n, paid_amount\n, allowed_amount\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved with exclusion logic applied.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_sum": {"name": "exclusion_sum", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_rate": {"name": "performance_rate", "description": "Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.4796398, "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": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_counts.sql", "compiled": true, "compiled_code": "\n\nwith summary_long as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Long view of the results for the reporting version of all measures. Each row represents the results a measure per patient. A null for the denominator indicates that the patient was not eligible for that measure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.494925, "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": [{"name": "quality_measures__int_nqf2372_long", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_wide": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Wide view of the results for the reporting version of all measures. This model pivots measures on the patient level (i.e. one row per patient with flags for each measure. The false flags can be treated as care gaps as exclusions have been included in the pivot logic.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "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, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.494925, "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": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_wide.sql", "compiled": true, "compiled_code": "\n\n/*\n Each measure is pivoted into a boolean column by evaluating the\n denominator, numerator, and exclusion flags.\n*/\nwith measures_long as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.494925, "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": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18'\n )\n\n as date) as performance_period_begin\n , cast('2023-09-18'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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.494925, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with a mastectomy for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5257847, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_dementia", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_hospice", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_institutional", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_mastectomy", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_palliative", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 2372, Breast Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5257847, "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": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5257847, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.541411, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging encounters from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.541411, "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": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.541411, "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": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__observation": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5570354, "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": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__patient": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medical claims from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "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": "0daac473352f61c08f988c8ab8a846407106b72a95c0570c736dc3a74deae274"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounters from the stg_encounter model, and for each encounter_id we add fields relevant for the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_disposition_code_flag": {"name": "missing_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_discharge_disposition_code_flag": {"name": "invalid_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnoses_flag": {"name": "multiple_primary_diagnoses_flag", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code_flag": {"name": "invalid_primary_diagnosis_code_flag", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_ms_drg_flag": {"name": "missing_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with a missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_ms_drg_flag": {"name": "invalid_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with an invalid missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.5894413, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_admission", "package": null, "version": null}, {"name": "readmissions__planned_encounter", "package": null, "version": null}, {"name": "readmissions__encounter_specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter_data_quality", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_data_quality"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__encounter_augmented.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter model\n-- and we augment them with extra fields\n-- that are relevant for readmission measures\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "d23797e63755cd3577c7f8a996f0ce273404bb6946a78b42c1bd26c54ddf29d0"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all rows from the encounter_augmented model where disqualified_encounter_flag = 0 (all rows for encounters that are not disqualified for data quality issues). For each of these encounters we add fields to indicate whether it had a readmission and, when a readmission was present, to show relevant fields for the readmission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "unplanned_readmit_30_flag": {"name": "unplanned_readmit_30_flag", "description": "A flag to indicate whether the encounter had an unplanned 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_disposition_code": {"name": "readmission_discharge_disposition_code", "description": "The valid 2-digit discharge status for the readmission inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_length_of_stay": {"name": "readmission_length_of_stay", "description": "Integer representing the length of stay of the readmission inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmission_index_admission_flag": {"name": "readmission_index_admission_flag", "description": "Flag to indicate if the readmission encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_died_flag": {"name": "readmission_died_flag", "description": "Flag to indicate of the patient died in the readmission encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.60513, "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": [{"name": "readmissions__encounter_augmented", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter_augmented"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__readmission_summary.sql", "compiled": true, "compiled_code": "\n\n-- Here calculate days to readmission for encounters\n-- that had a readmission and create readmission flags\n\n\n-- We create the encounter_sequence integer count\n-- which keeps track of what number of encounter each\n-- encounter is for a given patient\nwith encounter_sequence as (\nselect\n *,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom\n encounter_sequence aa\n left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\nselect *\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__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": "4b460d9cc3286c8f921fb550420c721c8f9f44f2b57bce7e6747953c70973f51"}, "config": {"enabled": true, "alias": "_int_stg_diagnosis", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique 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, "constraints": [], "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.6568325, "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": [{"name": "readmissions__stg_core__condition", "package": null, "version": null}, {"name": "readmissions__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__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": "5b485cdf20bb22edb4b4a1bf63eb844aca501ffc84845a3b700e9c879a9c9f57"}, "config": {"enabled": true, "alias": "_int_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.60513, "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": [{"name": "readmissions__diagnosis", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "readmissions__icd_10_cm_to_ccs", "package": null, "version": null}, {"name": "readmissions__primary_diagnosis_count", "package": null, "version": null}], "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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique acute inpatient encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_status_code": {"name": "discharge_status_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6568325, "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": [{"name": "readmissions__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount as total_paid_amount,\n '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "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": "28ffdacb8ba06a3c8437791944199132035c78a224739e274ea18426ec95690b"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model has the same number of rows as the stg_encounter model. Here we have one row for every unique encounter in the stg_encounter model, and for each encounter we have a flag (disqualified_encounter_flag) to indicte if the encounter is disqualified from being useful for readmission measures. We also have other flags to indicate which specific data quality issues this encounter has that may disqualify it from being used in readmission measures.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "The CCS diagnosis category associated with the primary diagnosis of this encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_status_code_flag": {"name": "missing_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_discharge_status_code_flag": {"name": "invalid_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnosis": {"name": "multiple_primary_diagnosis", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code": {"name": "invalid_primary_diagnosis_code", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "readmissions__primary_diagnosis_count", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter", "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "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": "1c7b360019c87f39f47fca7555497ea60e76437e12651b9ad530231d23dd69c4"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all pairs of encounters that have some date overlap.", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "compiled": true, "compiled_code": "\n\n-- Here we give a list of all pairs of encounters\n-- that have some date overlap.\n\n\nwith encounters_with_row_num as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over (\n partition by patient_id order by encounter_id\n\t) as row_num\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "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": "15b18818225404f45fd340e90d5a1f5091b3b4749449afd9ca12dc98c7bc5318"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists the specialty cohort associated with each inpatient encounter. All encounters in the stg_encounter model are present here, and each gets a specialty cohort assigned from the following list of 5 options: Surgery/Gynecology, Medicine, Cardiorespiratory, Cardiovascular, Neurology. Encounters that don't have a specialty cohort get 'Medicine' assigned by default.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__surgery_gynecology_cohort", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "971c59e8ac1cd4109b624c18661cd21bdcece87d519e295ad527877cf9f272e6"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that are excluded from being index admissions because they belong to one of the exclusion categories.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__exclusion_ccs_diagnosis_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_admission": {"database": "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": "6738ce6caa0e59ff726e0de97727f6690a8a50588bbcc80d7273f0529c8f7b28"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all index admissions for the hospital wide readmissions measure. These represent encounter_ids that meet the requirements to be an index admission for the HWR measure.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_time_requirement", "package": null, "version": null}, {"name": "readmissions__index_discharge_requirement", "package": null, "version": null}, {"name": "readmissions__exclusion", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__exclusion"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_admission.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all index admissions for the hospital wide readmissions\n-- measure.\n-- These represent encounter_ids that meet the requirements to be an\n-- index admission for the HWR measure.\n-- These are the requirements for a hospitalization to be an index admission\n-- for the HWR measure:\n--\n-- Time Requirement: The discharge data must be at least 30 days\n-- earlier than the last dischareg date available\n-- in the dataset.\n-- \n-- Discharge Requirements: The patient must not be discharged to another\n-- acute care hospital; the patient must not have\n-- left against medical advice; and the patient\n-- must be alive at discharge.\n--\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\n-- (exclusions) diagnosis category we know the encounter was\n-- for medical treatment of cancer, rehabilitation,\n-- or psychiatric reasons.\n\n\n\nselect distinct a.encounter_id, '2023-09-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the discharge disposition requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the discharge_disposition_code requirements to be an\n-- index admission:\n-- *** Must NOT be discharged to another acute care hospital\n-- *** Must NOT have left against medical advice\n-- *** Patient must be alive at discharge\n\n\n\nwith all_invalid_discharges as (\nselect encounter_id\nfrom 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-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "40c6de083114da8d6532fdb522bc8a8410818581c59dd50154d288c07dc56674"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the time requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the time requirement to be an index admission:\n-- The discharge date must be at least 30 days\n-- earlier than the last discharge date available\n-- in the dataset.\n\n\n\nselect encounter_id, '2023-09-18 13:42:56.047133+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "96a7a74e0a4225446cb107fcc6fd6d6295a0cc43d4df83e2b123e072797eba46"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model gives a list of all encounter_ids that were planned encounters.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_diagnosis_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_icd_10_cm", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__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-18 13:42:56.047133+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__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": "3bc2a8857da46830d11058b12ce0f2f13553f2e233e5d193e3a17c0866c28094"}, "config": {"enabled": true, "alias": "_int_primary_diagnosis_count", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.6357615, "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": [{"name": "readmissions__diagnosis", "package": null, "version": null}, {"name": "readmissions__diagnosis", "package": null, "version": null}], "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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom all_primary_diagnosis_count", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "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": "f6e02b38211237f005f1473d0354f0a7bd5682f51b8d75cacdba48a87f3ab80a"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all procedures from the stg_procedure model and adds a valid_icd_10_pcs_flag to indicate if the ICD-10-PCS code for this procedure is valid. We also add the CCS procedure category associated with the procedure", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "valid_icd_10_pcs_flag": {"name": "valid_icd_10_pcs_flag", "description": "A flag indicating if the ICD-10-PCS procedure code given is valid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_procedure_category": {"name": "ccs_procedure_category", "description": "The CCS code associated with the given ICD-10-PCS procedure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6532915, "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": [{"name": "readmissions__stg_core__procedure", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__icd_10_pcs_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "909dc931da16c541ec984f85ed9e0a00c405c6c8dbed2c5ffb1fd7398b5228af"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters and whether they had a 'crude' readmission, meaning that the encounter had a hospitalization after discharge, without regard to all CMS readmission logic.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6568325, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "compiled": true, "compiled_code": "\n\n-- Here we calculate readmissions using all encounters\n-- that have valid admit and discharge dates and no overlap.\n-- This is meant to give a crude sense of the readmission\n-- rate without taking into account all the CMS HWR logic.\n\n\nwith encounter_info as (\nselect\n enc.encounter_id,\n enc.patient_id,\n enc.admit_date,\n enc.discharge_date\nfrom 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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "tuva", "schema": "test", "name": "readmissions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__condition.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__condition", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__condition"], "alias": "readmissions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "4ea14670bd02d6f754b0f9a16b1b45901fc4867994744bc8bac7c0158a709e6f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "tuva", "schema": "test", "name": "readmissions__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__encounter.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__encounter", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__encounter"], "alias": "readmissions__stg_core__encounter", "checksum": {"name": "sha256", "checksum": "5249f0c60b5b8811dd92025a0ec873c8bd58e0424e987c86cb9f383a2777a052"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount as total_paid_amount,\n '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__medical_claim": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "tuva", "schema": "test", "name": "readmissions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__procedure.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__procedure", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__procedure"], "alias": "readmissions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "9e824936a255b3a5db4efb05406eefe00731e8e589c979fb05d558712df43e62"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2023-09-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9510415, "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": [{"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9666665, "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": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9666665, "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": [{"name": "quality_measures__summary_counts", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9666665, "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": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3342583, "relation_name": "tuva.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3342583, "relation_name": "tuva.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "9ae17ac5f4c0402ea13dbfbcfeaf80f4682ae1b1cea409938a13027190123e25"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4788878, "relation_name": "tuva.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "a30409aaf8f09a28b1f74504f93599124fa9668d4c237d7ac6f750b29077f59c"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3342583, "relation_name": "tuva.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "c729ee5edea312f536019ccadfb3faab36db065b2f28f3430c153aacf4c6debf"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.349885, "relation_name": "tuva.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__claim_type": {"database": "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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.349885, "relation_name": "tuva.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.349885, "relation_name": "tuva.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3657916, "relation_name": "tuva.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "9aae0124d4473a2c2270047023e09839d56ecaeaeb93ad9d5c0fa4b96487db20"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3657916, "relation_name": "tuva.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3657916, "relation_name": "tuva.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.3976545, "relation_name": "tuva.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_pcs": {"database": "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": "1d18cafa0d405e60cd1be1e039fbfb2dfa9591a1cef6a441b60c26a61de41ad3"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.3976545, "relation_name": "tuva.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_cm": {"database": "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3976545, "relation_name": "tuva.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "b44148131246b1ed7c1a1306dc9954f5452bc0bd1af9bcbba29ed5cea7dd6811"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4302733, "relation_name": "tuva.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "59c383f6987150669a1ced8a8362e2f742412ca86bb8631e2165e2de6501dec8"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4302733, "relation_name": "tuva.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.4462423, "relation_name": "tuva.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__payer_type": {"database": "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": "7e412080b0b85b4b94dd91b2deeb955c73fd1112826537c29fe7194ee0da35b9"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payer_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4462423, "relation_name": "tuva.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "bfdbdb39992351ff6f3c4ef9b69d0bcc8c5d1e4193b8a8d2efe275cf170c13a4"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4462423, "relation_name": "tuva.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "a53d973affea45af6de5f792bcf6569456f5a886340a7c2670c20b840b0f1d59"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4612515, "relation_name": "tuva.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.4612515, "relation_name": "tuva.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__race": {"database": "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": "04c8b2edc87b3c4a95053e5df9c7d7e82916c994a0659f327a835fe3526dcbc6"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"race_code": "varchar", "race_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4768798, "relation_name": "tuva.terminology.race", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "cbfe51143ddca77ca6964687e53c15b1df104d1244455668271f3eb8d04fee78"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4788878, "relation_name": "tuva.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "04926dcab30c1a58db064b4edfe3e367128b85e544dd922c4331858a8594203c"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.4928944, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"database": "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": "fd84423264c0174b1fc1e2ba23f1ac7957ef4fa7aaefcb2c45932f587b59fedf"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"database": "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": {}, "group": null, "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"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "765b1e8cf4a724b2269f44bc43e1d1ad8bbcdaf693afc6e2750e3f3f62b29ab3"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up into", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The icd10 code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_description": {"name": "icd_10_cm_description", "description": "The description for the icd10 code", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease hierarchies by model version. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.5409012, "relation_name": "tuva.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5409012, "relation_name": "tuva.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5409012, "relation_name": "tuva.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.5559072, "relation_name": "tuva.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5559072, "relation_name": "tuva.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.5559072, "relation_name": "tuva.data_profiling._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__categories": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__categories.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__categories.csv", "unique_id": "seed.the_tuva_project.ed_classification__categories", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__categories"], "alias": "_value_set_categories", "checksum": {"name": "sha256", "checksum": "2063ce406aa7ed5edc420f94712a2c07cd5d591da671b5fe5270fc6b74ab8a72"}, "config": {"enabled": true, "alias": "_value_set_categories", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A mapping of ED Classifications to human readable names", "columns": {"classification": {"name": "classification", "description": "code for classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "human readable name for classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "Sortable column that organizes the ED classes", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_categories", "tags": "ed_classification", "enabled": true}, "created_at": 1695044212.5559072, "relation_name": "tuva.ed_classification._value_set_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "ed_classification", "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "enabled": true}, "created_at": 1695044212.5721533, "relation_name": "tuva.ed_classification._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__johnston_icd10", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd10"], "alias": "_value_set_johnston_icd10", "checksum": {"name": "path", "checksum": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd10.csv"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd10", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd10": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd10": {"name": "icd10", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_johnston_icd10", "tags": "ed_classification", "enabled": true, "column_types": {"icd10": "varchar"}}, "created_at": 1695044212.5791607, "relation_name": "tuva.ed_classification._value_set_johnston_icd10", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__johnston_icd9", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd9"], "alias": "_value_set_johnston_icd9", "checksum": {"name": "sha256", "checksum": "2c03fd558f0551a067248da92996e296fc848ff18ebe7e3b4377c92055689c7a"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd9", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd9": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd9": {"name": "icd9", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_johnston_icd9", "tags": "ed_classification", "enabled": true, "column_types": {"icd9": "varchar"}}, "created_at": 1695044212.5791607, "relation_name": "tuva.ed_classification._value_set_johnston_icd9", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.587717, "relation_name": "tuva.quality_measures._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "group": null, "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": 1695044212.587717, "relation_name": "tuva.quality_measures._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6032238, "relation_name": "tuva.quality_measures._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "162e0b9ea270ac718cf9b09e73be76c24f989de8bd1914a1a057f7acb3f61ad7"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6032238, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6032238, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "3c043831ad01c7c64351d16f95ac22a634bbb966fd1e76d63fff7e02b62c217a"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6032238, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "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": "fd4817e3125593d3fba796d06308328d873b5f4c858e5e0eb334f7ad67b78d59"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6188514, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "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": "4acbeae1bdb123aa1f45a9de2fd1937fdf402207b0469265cf1b57a9d262c149"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6188514, "relation_name": "tuva.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.6344733, "relation_name": "tuva.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"database": "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.6344733, "relation_name": "tuva.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"database": "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": "eadf8c6d9111791ab7ab407746f15917d20837f5f3208299e52c12d9e5ae73b0"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6344733, "relation_name": "tuva.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "d043a3ac9422b5ff045a14b77bb0ecbef7e3515a85832e547b665206ce013170"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6500967, "relation_name": "tuva.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "776448ba060d5eaf1b1fa125c228d201c3e538a155b48a33694895c30b922138"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6514847, "relation_name": "tuva.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "2df8c3d1db81bb0c7fdbb3365290ea6ee22786c311298c05703ef49dcc1e37b4"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6514847, "relation_name": "tuva.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["service_category"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6514847, "relation_name": "tuva.service_category._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd9_icd9"], "alias": "unique_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd9 as unique_field,\n count(*) as n_records\n\nfrom tuva.ed_classification._value_set_johnston_icd9\nwhere icd9 is not null\ngroup by icd9\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd9_icd9"], "alias": "not_null_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd9\nfrom tuva.ed_classification._value_set_johnston_icd9\nwhere icd9 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd10_icd10"], "alias": "unique_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd10 as unique_field,\n count(*) as n_records\n\nfrom tuva.ed_classification._value_set_johnston_icd10\nwhere icd10 is not null\ngroup by icd10\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd10_icd10"], "alias": "not_null_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd10\nfrom tuva.ed_classification._value_set_johnston_icd10\nwhere icd10 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044212.6985013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\not_null_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044212.6985013, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\unique_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n claim_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1695044212.7637312, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1695044212.7637312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || claim_id || start_date || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || claim_id || start_date || condition) as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Opioid Use Disorder (OUD)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1695044212.8273559, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || condition) as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1695044212.8273559, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1695044212.8273559, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.unique_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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__patient_risk_scores_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores", "attached_node": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_demographic_factors", "attached_node": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_code", "model": "{{ get_where_subquery(ref('cms_hcc__int_eligible_conditions')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_code\nfrom tuva.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_code", "file_key_name": "models.cms_hcc__int_eligible_conditions", "attached_node": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_claim')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_ed_classification__int_condition_with_claim_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__int_condition_with_claim_claim_id.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba", "fqn": ["the_tuva_project", "ed_classification", "unique_ed_classification__int_condition_with_claim_claim_id"], "alias": "unique_ed_classification__int_condition_with_claim_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.3998904, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\unique_ed_classification__int_condition_with_claim_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.ed_classification._int_condition_with_claim\nwhere claim_id is not null\ngroup by claim_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ed_classification__int_condition_with_claim", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_claim')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__int_condition_with_claim_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__int_condition_with_claim_claim_id.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1", "fqn": ["the_tuva_project", "ed_classification", "not_null_ed_classification__int_condition_with_claim_claim_id"], "alias": "not_null_ed_classification__int_condition_with_claim_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.3998904, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\not_null_ed_classification__int_condition_with_claim_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.ed_classification._int_condition_with_claim\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ed_classification__int_condition_with_claim", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58": {"test_metadata": {"name": "equal_rowcount", "kwargs": {"compare_model": "ref('ed_condition_with_class')", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_claim')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_"], "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": false, "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "sum(coalesce(diff_count, 0))", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"fail_calc": "sum(coalesce(diff_count, 0))", "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0"}, "created_at": 1695044213.3998904, "relation_name": null, "raw_code": "{{ dbt_utils.test_equal_rowcount(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0\") }}", "language": "sql", "refs": [{"name": "ed_condition_with_class", "package": null, "version": null}, {"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_equal_rowcount", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.ed_classification__int_condition_with_claim", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17": {"test_metadata": {"name": "fewer_rows_than", "kwargs": {"compare_model": "ref('ed_condition')", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_class')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_"], "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": false, "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "sum(coalesce(row_count_delta, 0))", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"fail_calc": "sum(coalesce(row_count_delta, 0))", "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2"}, "created_at": 1695044213.3998904, "relation_name": null, "raw_code": "{{ dbt_utils.test_fewer_rows_than(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2\") }}", "language": "sql", "refs": [{"name": "ed_condition", "package": null, "version": null}, {"name": "ed_classification__int_condition_with_class", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_fewer_rows_than", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_class"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.ed_classification__int_condition_with_class", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_class"}, "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a": {"test_metadata": {"name": "equal_rowcount", "kwargs": {"compare_model": "ref('ed_condition')", "model": "{{ get_where_subquery(ref('ed_classification__int_merge_condition')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_"], "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": false, "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "sum(coalesce(diff_count, 0))", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"fail_calc": "sum(coalesce(diff_count, 0))", "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7"}, "created_at": 1695044213.416173, "relation_name": null, "raw_code": "{{ dbt_utils.test_equal_rowcount(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7\") }}", "language": "sql", "refs": [{"name": "ed_condition", "package": null, "version": null}, {"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_equal_rowcount", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.ed_classification__int_merge_condition", "attached_node": "model.the_tuva_project.ed_classification__int_merge_condition"}, "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ccs_description_with_covid", "model": "{{ get_where_subquery(ref('ed_classification__unclassified_conditions')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__unclassified_conditions_ccs_description_with_covid", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5", "fqn": ["the_tuva_project", "ed_classification", "not_null_ed_classification__unclassified_conditions_ccs_description_with_covid"], "alias": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169", "severity": "WARN"}, "created_at": 1695044213.416173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169\") }}", "language": "sql", "refs": [{"name": "ed_classification__unclassified_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__unclassified_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect ccs_description_with_covid\nfrom tuva.ed_classification._int_unclassified_conditions\nwhere ccs_description_with_covid is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "ccs_description_with_covid", "file_key_name": "models.ed_classification__unclassified_conditions", "attached_node": "model.the_tuva_project.ed_classification__unclassified_conditions"}, "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50": {"test_metadata": {"name": "accepted_range", "kwargs": {"max_value": 20, "column_name": "condition_row_unclassified_percent", "model": "{{ get_where_subquery(ref('ed_classification__unclassified_rows')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20"], "alias": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b"}, "created_at": 1695044213.416173, "relation_name": null, "raw_code": "{{ dbt_utils.test_accepted_range(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b\") }}", "language": "sql", "refs": [{"name": "ed_classification__unclassified_rows", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_accepted_range", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__unclassified_rows"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b.sql", "compiled": true, "compiled_code": "\n\nwith meet_condition as(\n select *\n from tuva.ed_classification._int_unclassified_rows\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 -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not condition_row_unclassified_percent <= 20\n)\n\nselect *\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_row_unclassified_percent", "file_key_name": "models.ed_classification__unclassified_rows", "attached_node": "model.the_tuva_project.ed_classification__unclassified_rows"}, "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.4796398, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\financial_pmpm_models.yml\\unique_financial_pmpm__pmpm_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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep", "attached_node": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__condition')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__condition_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__condition", "attached_node": "model.the_tuva_project.quality_measures__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__encounter')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__encounter_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.encounter\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__encounter", "attached_node": "model.the_tuva_project.quality_measures__stg_core__encounter"}, "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__medication')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__medication_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__medication", "attached_node": "model.the_tuva_project.quality_measures__stg_core__medication"}, "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__observation')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__observation_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__observation", "attached_node": "model.the_tuva_project.quality_measures__stg_core__observation"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.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": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_12782dbc4c931575c089a8978147a897\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\accepted_values_quality_measur_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-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_birth_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "birth_date", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__procedure')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__procedure_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-18 13:42:56.047133+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-18 13:42:56.047133+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure", "attached_node": "model.the_tuva_project.quality_measures__stg_core__procedure"}}, "sources": {}, "macros": {"macro.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": 1695044209.5939333, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_table_as": {"name": "snowflake__create_table_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_table_as", "macro_sql": "{% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {% set compiled_code = get_select_subquery(compiled_code) %}\n {% endif %}\n {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from (\n {{ compiled_code }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ compiled_code }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n\n {%- elif language == 'python' -%}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation, temporary=temporary) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"snowflake__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery", "macro.dbt_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag": {"name": "snowflake__create_view_as_with_temp_flag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro_sql": "{% macro snowflake__create_view_as_with_temp_flag(relation, sql, is_temporary=False) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} {% if is_temporary -%}\n temporary\n {%- endif %} view {{ relation }}\n {% if config.persist_column_docs() -%}\n {% set model_columns = model.columns %}\n {% set query_columns = get_columns_in_query(sql) %}\n {{ get_persist_docs_column_list(model_columns, query_columns) }}\n\n {%- endif %}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt_snowflake.get_persist_docs_column_list", "macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_relations_without_caching": {"name": "snowflake__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_relations_without_caching", "macro_sql": "{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many objects in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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.use_database(target_relation.database)\n session.use_schema(target_relation.schema)\n # session.write_pandas does not have overwrite function\n df = session.createDataFrame(df)\n {% set target_relation_name = resolve_model_name(target_relation) %}\n df.write.mode(\"overwrite\").save_as_table('{{ target_relation_name }}', create_temp_table={{temporary}})\n\ndef main(session):\n dbt = dbtObj(session.table)\n df = model(dbt, session)\n materialize(session, df, dbt.this)\n return \"OK\"\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_view_snowflake": {"name": "materialization_view_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\view.sql", "original_file_path": "macros\\materializations\\view.sql", "unique_id": "macro.dbt_snowflake.materialization_view_snowflake", "macro_sql": "{% materialization view, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.create_or_replace_view", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6568627, "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": 1695044209.6576471, "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": 1695044209.6576471, "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": 1695044209.6576471, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql) %}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {{ col_err.append(col['name']) }}\n {%- endif -%}\n cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "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": 1695044209.661002, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "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": 1695044209.6765091, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6922905, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(model['columns'])) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select\n {% for column in model['columns'] %}\n {{ column }}{{ \", \" if not loop.last }}\n {% endfor %}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "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": 1695044209.7548728, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "original_file_path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7704952, "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": 1695044209.7704952, "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": 1695044209.7704952, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.818285, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8653698, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": {}, "groups": {}, "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.ed_classification__claim_categorization": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "model.the_tuva_project.ed_classification__unclassified_conditions": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__unclassified_rows": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "seed.the_tuva_project.ed_classification__categories"], "model.the_tuva_project.ed_classification__int_by_ccs_description": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_patient_race": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_provider_parent_organization": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_provider_practice_state": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_year": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_year_month": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_condition_with_claim": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_medical_claim", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.ed_classification__int_condition_with_class": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__int_merge_condition": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim", "seed.the_tuva_project.ed_classification__johnston_icd10", "seed.the_tuva_project.ed_classification__johnston_icd9"], "model.the_tuva_project.ed_classification__int_patient_list": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories"], "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": ["model.the_tuva_project.ed_classification__stg_condition", "model.the_tuva_project.ed_classification__stg_encounter", "model.the_tuva_project.ed_classification__stg_medical_claim", "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"], "model.the_tuva_project.ed_classification__stg_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ed_classification__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_eligibility", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.financial_pmpm__pmpm": ["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.ed_classification__categories": [], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": [], "seed.the_tuva_project.ed_classification__johnston_icd9": [], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": [], "seed.the_tuva_project.quality_measures__value_sets": [], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": [], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": [], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": [], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": [], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": [], "seed.the_tuva_project.readmissions__specialty_cohort": [], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": [], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.unique_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_ed_classification__int_condition_with_claim_claim_id.83085e1bba": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17": ["model.the_tuva_project.ed_classification__int_condition_with_class"], "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a": ["model.the_tuva_project.ed_classification__int_merge_condition"], "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5": ["model.the_tuva_project.ed_classification__unclassified_conditions"], "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50": ["model.the_tuva_project.ed_classification__unclassified_rows"], "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.ed_classification__stg_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.ed_classification__stg_encounter", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.core__lab_result": [], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.ed_classification__stg_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.ed_classification__stg_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.ed_classification__claim_categorization": [], "model.the_tuva_project.ed_classification__unclassified_conditions": ["test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5"], "model.the_tuva_project.ed_classification__unclassified_rows": ["test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ed_classification__int_by_ccs_description", "model.the_tuva_project.ed_classification__int_by_ccs_description", "model.the_tuva_project.ed_classification__int_by_patient_race", "model.the_tuva_project.ed_classification__int_by_patient_race", "model.the_tuva_project.ed_classification__int_by_provider_parent_organization", "model.the_tuva_project.ed_classification__int_by_provider_parent_organization", "model.the_tuva_project.ed_classification__int_by_provider_practice_state", "model.the_tuva_project.ed_classification__int_by_provider_practice_state", "model.the_tuva_project.ed_classification__int_by_year", "model.the_tuva_project.ed_classification__int_by_year_month", "model.the_tuva_project.ed_classification__int_by_year_month"], "model.the_tuva_project.ed_classification__int_by_ccs_description": [], "model.the_tuva_project.ed_classification__int_by_patient_race": [], "model.the_tuva_project.ed_classification__int_by_provider_parent_organization": [], "model.the_tuva_project.ed_classification__int_by_provider_practice_state": [], "model.the_tuva_project.ed_classification__int_by_year": [], "model.the_tuva_project.ed_classification__int_by_year_month": [], "model.the_tuva_project.ed_classification__int_condition_with_claim": ["model.the_tuva_project.ed_classification__claim_categorization", "model.the_tuva_project.ed_classification__summary", "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58", "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1", "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba"], "model.the_tuva_project.ed_classification__int_condition_with_class": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "model.the_tuva_project.ed_classification__int_patient_list", "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17"], "model.the_tuva_project.ed_classification__int_merge_condition": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__unclassified_conditions", "model.the_tuva_project.ed_classification__unclassified_rows", "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a"], "model.the_tuva_project.ed_classification__int_patient_list": [], "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__stg_condition": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "model.the_tuva_project.ed_classification__stg_medical_claim": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "model.the_tuva_project.ed_classification__int_patient_list"], "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", "model.the_tuva_project.ed_classification__int_condition_with_claim"], "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.ed_classification__categories": ["model.the_tuva_project.ed_classification__int_patient_list", "model.the_tuva_project.ed_classification__summary"], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "seed.the_tuva_project.ed_classification__johnston_icd10": ["model.the_tuva_project.ed_classification__int_merge_condition", "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"], "seed.the_tuva_project.ed_classification__johnston_icd9": ["model.the_tuva_project.ed_classification__int_merge_condition", "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"], "seed.the_tuva_project.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.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": [], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": [], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": [], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": [], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": [], "test.the_tuva_project.unique_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_ed_classification__int_condition_with_claim_claim_id.83085e1bba": [], "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1": [], "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58": [], "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17": [], "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a": [], "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5": [], "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50": [], "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": []}, "group_map": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v9.json", "dbt_version": "1.5.1", "generated_at": "2023-09-20T12:50:16.670928Z", "invocation_id": "a2f9bb74-6e78-4b20-b34d-c110dc64cef3", "env": {}, "project_id": "228f02ae210381b07ccf62fcaa654d94", "user_id": "c5ffe329-cd24-4f82-be78-c62b00387d3d", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.claims_data_model.condition": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1839223, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "1e55465f5e10badfd895ead0a6d443e5b07a2ec789f9917d7108f9b36417ac2d"}, "config": {"enabled": true, "alias": null, "schema": "claims_data_model", "database": "tuva", "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.1788478, "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.encounter": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1995986, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.lab_result": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1995986, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.location": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.1995986, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.2385423, "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.medication": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.observation": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.patient": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "/terminology/medications/ndc"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.2385423, "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.practitioner": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.claims_data_model.procedure": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a0707"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044210.2155626, "relation_name": "tuva.test.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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.2541661, "relation_name": "tuva.tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3183432, "relation_name": "tuva.tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "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": 1695044212.3183432, "relation_name": "tuva.tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "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": "b4b74e4440c0c015191981747b2a8cd39a2af7ee86438ce1752b9075eb447a06"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-CM diagnosis codes to the CCSR's clinically meaningful diagnosis categories. Each row represents a mapping of an ICD-10 code to a CCSR category. As each ICD-10 code may be mapped to up to 6 categories, it's expected that this table will output as many or more rows than the TUVA condition model. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-CM code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The description of the CCSR category as provided in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6823828, "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": [{"name": "ccsr__dx_vertical_pivot", "package": null, "version": null}, {"name": "ccsr__stg_core__condition", "package": null, "version": null}, {"name": "ccsr__dxccsr_v2023_1_body_systems", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_condition_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect *, '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-PCS procedure codes to the CCSR's clinically meaningful procedure categories. Each row represents a mapping of an ICD-10 code to a CCSR category. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-PCS code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The ICD-10-PCS Clinical Domain that the CCSR parent category belongs to. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.697388, "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": [{"name": "ccsr__stg_core__procedure", "package": null, "version": null}, {"name": "ccsr__procedure_category_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.ccsr__procedure_category_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_procedure_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect *, '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains only the CCSR's default category assignment for the ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6823828, "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": [{"name": "ccsr__long_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__singular_condition_category.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n ccsr_category_description,\n ccsr_parent_category,\n parent_category_description,\n body_system,\n '2023.1' as dxccsr_version,\n '2023-09-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6823828, "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": [{"name": "ccsr__dx_vertical_pivot", "package": null, "version": null}, {"name": "ccsr__long_condition_category", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6985013, "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": [{"name": "ccsr__procedure_category_map", "package": null, "version": null}, {"name": "ccsr__long_procedure_category", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that pivots the DXCCSR's wide-format mapping CSV\ninto a long format table. While the seed uses 6 columns to represent the 6 CCSR codes that\nmay be present, this generates one row for each CCSR category per ICD code, so up to\n6 rows per code. \n\nThis model includes details and descriptions of the CCSR parent category and body systems that are inherited by the final models.\n\nThis model may also be useful in looking up CCSR condition category, body system, and parent category information.\n", "columns": {"code": {"name": "code", "description": "The ICD-10-CM code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-CM code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6715968, "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": [{"name": "ccsr__dxccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "compiled": true, "compiled_code": "\n\nwith codes as (\n \n select\n icd_10_cm_code as code, \n icd_10_cm_code_description as code_description,\n -- loop to generate columns for CCSR categories 1-6\n ccsr_category_1,\n ccsr_category_1_description,\n ccsr_category_2,\n ccsr_category_2_description,\n ccsr_category_3,\n ccsr_category_3_description,\n ccsr_category_4,\n ccsr_category_4_description,\n ccsr_category_5,\n ccsr_category_5_description,\n ccsr_category_6,\n ccsr_category_6_description,\n default_ccsr_category_ip,\n default_ccsr_category_op\n from 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom long_union\n-- as not all diagnosis codes have multiple categories, we can discard nulls\nwhere ccsr_category is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that renames some PRCCSR columns to align with other TUVA models as well as the `ccsr__dx_vertical_pivot` model.", "columns": {"code": {"name": "code", "description": "The ICD-10-PCS code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-PCS code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The clinical domain to which the CCSR code belongs. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6746333, "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": [{"name": "ccsr__prccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "compiled": true, "compiled_code": "\n\nselect \n icd_10_pcs as code,\n icd_10_pcs_description as code_description,\n prccsr as ccsr_category,\n left(prccsr, 3) as ccsr_parent_category,\n prccsr_description as ccsr_category_description,\n clinical_domain,\n '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "tuva", "schema": "test", "name": "ccsr__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__condition.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__condition", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__condition"], "alias": "ccsr__stg_core__condition", "checksum": {"name": "sha256", "checksum": "58bfbd6d39695f1589b0cdb3e898932d48e10765563ac69c3489e1094b0e1a15"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6985013, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect *, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "tuva", "schema": "test", "name": "ccsr__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__procedure.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__procedure", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__procedure"], "alias": "ccsr__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "44d8ae3e59950ce973f04cc24eb71d41efb4fcd04e1ab181ffade1ef71e5b626"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6985013, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect *, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model unions condition flags from the 3 upstream stage models that calculate them.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7480955, "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": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith conditions_unioned as (\n\n select * from 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model pivots conditions on the patient level (i.e. one record per patient) with flags for each chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids": {"name": "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis": {"name": "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "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", "constraints": [], "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", "constraints": [], "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", "constraints": [], "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system": {"name": "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage": {"name": "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "chronic condition flag 1 or 0", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7322543, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient per condition using the tuva chronic conditions hierarchy as the grouper. The model pulls in the first and last date of the diagnosis that flagged the patient for this condition group.\n", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for a patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_diagnosis_date": {"name": "first_diagnosis_date", "description": "The first date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_diagnosis_date": {"name": "last_diagnosis_date", "description": "The last date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.811649, "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": [{"name": "tuva_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient with flags for all the conditions in the tuva chronic conditions hierarchy. A patient will have a 1 in the column for a certain condition if they have every been coded with a diagnosis that rolls up to that condition and a 0 if not.\n", "columns": {"patient_id": {"name": "patient_id", "description": "ID of the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.8273559, "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": [{"name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "tuva_chronic_conditions__stg_core__patient", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for all chronic conditions where additional_logic is not 'None'. This model includes standard exclusions and maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and MS DRG codes to chronic conditions.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7480955, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS). This model maps ICD-10-CM diagnosis codes and MS DRG codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7480955, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Opioid Use Disorder (OUD). This model maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and NDC codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_pharmacy_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__condition"], "alias": "cms_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "14bc859c362a0bf063c1f1b5573c4c3c579fe36fd016b68a559c9d342ad97a8a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__patient"], "alias": "cms_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "c1179facf8d0fe84d23bb48595d8788b7ea24239af870f2765aeda6b3202b689"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__procedure"], "alias": "cms_chronic_conditions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "a2edc7f43347634a329a5572d5f6d1070cb7b922b028572a264d75b6574765f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_medical_claim"], "alias": "cms_chronic_conditions__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "837370350f0cfe6af7920826ec0af6ad83b3c1e27127cfdf58e08341fcaa0257"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "tuva", "schema": "test", "name": "cms_chronic_conditions__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_pharmacy_claim"], "alias": "cms_chronic_conditions__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "31b3681bfce9e02877c6b2a296a731d66d53751cec210a6ee7367f78271c1198"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.7637312, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "tuva", "schema": "test", "name": "tuva_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__condition"], "alias": "tuva_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "48dd1d737654e1702b462ae927368771052d05c66bd16365187e51f67470f5ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8273559, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "tuva", "schema": "test", "name": "tuva_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__patient"], "alias": "tuva_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "1f922ebd0ff235d61d3cecfacf5b7fb056cf6b55b1dc14c054df6b07b38e4a0b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8273559, "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": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": "d5222aec075d58306c2d82d32978bb46ea5b2769dcf83caa0b553f5b4b3ea4bd"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.8423634, "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": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_eligibility", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "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": "53cb5eb69fc4628a336f969c3a9e59fbfdb5674b94da0e7a6f17a5101d2063d4"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns relevant encounter-level\n-- data for every professional or institutional\n-- acute inpatient claim that is part of an encounter\n-- (note that all institutional acute inpatienet claims\n-- are part of an acute inpatient encounter, but only\n-- professional acute inpatient claims that are not\n-- orphan claims and that belong to one and only\n-- one encounter, i.e. have encounter_count = 1,\n-- are part of an acute inpatient encounter).\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_id\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- *************************************************\n\n\n\n\nwith useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.admit_type_code,\n aa.admit_source_code,\n aa.discharge_disposition_code,\n aa.start_date,\n aa.end_date,\n\n bb.encounter_id,\n\n cc.encounter_start_date,\n cc.encounter_end_date\n\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "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": "2d8f929a5b5b85f848b0f60f6b32b35bb67f83f70cf9e08ebf97f10b11dd1463"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model summarizes data quality issues\n-- that could affect claims preprocessing.\n-- The table returns 2 fields:\n-- field\n-- total_count\n--\n-- If we order the results by 'field', the first\n-- 3 rows give us a high level summary:\n--\n-- 01 Total acute inpatient institutional claims:\n-- This is the total number of acute inpatient\n-- institutional claims\n-- 02 Acute inpatient institutional claims with insights:\n-- This is the number of acute inpatient institutional\n-- claims for which something is not ideal (e.g. they\n-- are missing a claim_start_date) but it's not something\n-- that prevents the claim from being used in the\n-- encounter grouper.\n\n-- 03 Acute inpatient institutional claims with problems:\n-- This is the number of acute inpatient institutional\n-- claims that have a data quality problem that\n-- prevents them from being used in the encounter grouper.\n\n-- The rest of the rows in the table give us counts\n-- of the number of acute inpatient institutional claims\n-- that have specific data quality problems.\n-- *************************************************\n\n\n\n\nwith total_acute_inpatient__institutional_claims as (\nselect\n '01 Total acute inpatient institutional claims' as field,\n count(*) as total_count\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "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": "b8d0cd8b50a6de2e907b69b4bf07ffdbe49d85231a4b9f1dbdec426a69b179a5"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8744962, "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": [{"name": "acute_inpatient__claims_with_encounter_data", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns all the columns with relevant\n-- encounter fields that we will append to the medical_claim\n-- table.\n\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- encounter_type\n-- encounter_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- orphan_claim_flag (always 0 or 1) (never null)\n-- encounter_count (could be 0,1,2,3,...) (never null)\n-- *************************************************\n\n\n\n\nwith acute_inpatient_claims_with_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' as encounter_type,\n encounter_id,\n encounter_start_date,\n encounter_end_date,\n encounter_admit_source_code,\n encounter_admit_type_code,\n encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n 0 as orphan_claim_flag,\n 1 as encounter_count\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "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": "07e04738060b76d3742ef5f62c88d54aa70e89e2cdbad424f19e61b4fab2015c"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "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": "ebf6077a6552eacde798cea20830fd9ab5af452862199f563a4081aa832ac943"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns an encounter_start_date and\n-- an encounter_end_date to each acute inpatient\n-- encounter_id.\n-- This returns a table with 4 fields:\n-- patient_id\n-- encounter_id\n-- encounter_start_date\n-- encounter_end_date\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient encounters.\n-- *************************************************\n\n\nwith add_encounter_id_to_acute_inpatient_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.8423634, "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": [{"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__stg_service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category__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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "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": "7cdfbbcf1607918ec25654f7564a75ea8a4fb364e7785c116e9c3806e29d44d4"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__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": "1265f56d7db0ed180ee11974350eee271b213b32bf4f385a9265555bfdc43327"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "group": null, "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": 1695044212.858651, "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": [{"name": "acute_inpatient__stg_service_category__service_category_grouper", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category__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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "tuva", "schema": "test", "name": "acute_inpatient__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "2ff7c8bcfa4a92ed7c706b5ba9837ab9f73ace3b51ddb4a17697b0f89f532d37"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8744962, "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": [{"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "acute_inpatient__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "c830558bd8993dcb25434dc80de7850519dc42e8c6585bcc760408af37ac8b22"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_service_category__service_category_grouper": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, service_category_2\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9794867, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "claims_date_profiling__medical_claim_dates", "package": null, "version": null}, {"name": "claims_date_profiling__pharmacy_claim_dates", "package": null, "version": null}, {"name": "claims_date_profiling__duplicate_dates", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._int_duplicate_dates c\norder by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": "10104ed02e95533f702d57975058acb6ca4d6f87c1aec5c302ffb79c9ff72aea"}, "config": {"enabled": true, "alias": "_int_duplicate_dates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom combine\norder by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.967975, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom rx_pivot_prep\ngroup by year_month", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.9523506, "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": [{"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__medical_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_profiling__claim_type_unmapped", "package": null, "version": null}, {"name": "data_profiling__medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_profiling__institutional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__professional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_duplicates", "package": null, "version": null}, {"name": "data_profiling__eligibility_invalid_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_missing_values", "package": null, "version": null}, {"name": "data_profiling__pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__pharmacy_claim_missing_values", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.9523506, "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": [{"name": "data_profiling__test_detail_stage_medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail_stage_eligibility", "package": null, "version": null}, {"name": "data_profiling__test_detail_stage_pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_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": "3fe77291d3769dfb1debe6ff5727fe0c144b40689b3cad2bc0206c6a1ac07e48"}, "config": {"enabled": true, "alias": "test_result", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.9523506, "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": [{"name": "data_profiling__test_result_stage_medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_result_stage_eligibility", "package": null, "version": null}, {"name": "data_profiling__test_result_stage_pharmacy_claim", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.9523506, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "pharmacy_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9056318, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "9248c1c3e96379fd05b64f3e51878895d068e41ad958706f8aa6cf10ea0af3da"}, "config": {"enabled": true, "alias": "_int_eligibility_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "7e01818df529370486825af59e6a605051e95147b938062b5f97ee16c8a77758"}, "config": {"enabled": true, "alias": "_int_eligibility_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}, {"name": "terminology__gender", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__race", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__payer_type", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__medicare_dual_eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "terminology__medicare_status", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n patient_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8795033, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "652f0ff0f277b997df0ea1643619960dec3925a7529f02fb7b8ececab74f9ca4"}, "config": {"enabled": true, "alias": "_int_institutional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "data_profiling__institutional_header_failures", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "c89e733d401fe7f70977ccd73c65be3e87a274ee79bdbbc1d81b5328ccf7bb61"}, "config": {"enabled": true, "alias": "_int_medical_claim_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom institutional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom professional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8895104, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "799a9cfefd8e6b72008b778dcb5af520e1c64d39c2321ef36e35a47eb0376565"}, "config": {"enabled": true, "alias": "_int_professional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.8901246, "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": [{"name": "data_profiling__professional_header_failures", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "data_profiling__eligibility_duplicates", "package": null, "version": null}, {"name": "data_profiling__eligibility_missing_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_invalid_values", "package": null, "version": null}, {"name": "data_profiling__eligibility_plausibility", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "88abe6cbdbe41510643bb0afeb061694aa386233a32b3fd24ad7dd638fb52184"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "data_profiling__institutional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__professional_header_fail_details", "package": null, "version": null}, {"name": "data_profiling__medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_profiling__medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_profiling__claim_type_unmapped", "package": null, "version": null}, {"name": "data_profiling__claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_profiling__medical_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__medical_claim_plausibility", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "data_profiling__pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_profiling__pharmacy_claim_missing_values", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "0584a4b85701bd2278975a8c22e89728f97a3dc07622dcafcfc38da9567618a8"}, "config": {"enabled": true, "alias": "_int_test_result_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9211016, "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": [{"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__eligibility_denominators", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__eligibility_denominators", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9065115, "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": [{"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__medical_claim_denominators", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}, {"name": "data_profiling__medical_claim_denominators", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "349207b0b7759006dcfd3104a4812c76e5dcc51391ec131822398a733f65d151"}, "config": {"enabled": true, "alias": "_int_test_result_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling"], "meta": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9367292, "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": [{"name": "pharmacy_claim", "package": null, "version": null}, {"name": "data_profiling__test_detail", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__dq_input_layer_tests", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__dq_input_layer_tests"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "compiled": true, "compiled_code": "\n\nselect\n dq_problem\n, count(distinct claim_id) as distinct_claims\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__claim_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, count(distinct service_category_2) as distinct_service_category_count\n, '2023-09-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0797164, "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": [{"name": "service_category__combined_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, claim_line_number\n, count(distinct service_category_2) as distinct_service_category_count\n, '2023-09-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "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": "81447058887627ad324b36a80b13b94f71cd7c19e0ced18d814ba746a29349dd"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__combined_institutional": {"database": "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": "cebd777b5aeeff5a1b6e1aafa2dff8d4c324310a5ab9426cac33ce8878feeefc"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__acute_inpatient_institutional", "package": null, "version": null}, {"name": "service_category__dialysis_institutional", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__home_health_institutional", "package": null, "version": null}, {"name": "service_category__hospice_institutional", "package": null, "version": null}, {"name": "service_category__lab_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_institutional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "93e0719b1469fa43e88e34f477b9c80351736512e0fc92c65270bf370b318a68"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9839962, "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": [{"name": "service_category__acute_inpatient_professional", "package": null, "version": null}, {"name": "service_category__ambulance_professional", "package": null, "version": null}, {"name": "service_category__ambulatory_surgery_professional", "package": null, "version": null}, {"name": "service_category__dialysis_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__emergency_department_professional", "package": null, "version": null}, {"name": "service_category__home_health_professional", "package": null, "version": null}, {"name": "service_category__hospice_professional", "package": null, "version": null}, {"name": "service_category__inpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__inpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__lab_professional", "package": null, "version": null}, {"name": "service_category__office_visit_professional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_professional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__outpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_professional", "package": null, "version": null}, {"name": "service_category__urgent_care_professional", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "03e1af6a145e9c4a6f23d31a9b882bafd00036bdd054de84f95f397db5dd5c60"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "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": "7f551f541a0021eec53a302ada51513edd1d4870c138994cfd71b684e46819b8"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dme_professional": {"database": "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": "e9fbe2c9a468a5d73b830a9da8c096cc5d12faec34c3aa3e08ecb06f4e8eda0c"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044212.9996223, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "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": "0d8d6284fb90b70bf5bd1034b4fa97081cd108f21d8d59ad22e9c8c75fb9b6c5"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "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": "bec62179109f857081e5577a6cca5825284630d210d024562c5c369f16ebb1cc"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_professional": {"database": "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": "49bc77a20cf97e54a0f83a1cea5f84928c397c7027580e2d095267e4d37614be"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "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": "b03550336364d25cfa620b4dec349cd1b544b071a9f96bc1bb61ed158a86d1cd"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0160894, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_professional": {"database": "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": "a62a306193ced439567e9508b2ee6ea4c521e7907d524784c4a4c98fa13fa2db"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "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": "6fa6654b93b4504d0bb3e234076c694f6f97964a9efbc1b52aa660f3a8c9fa6f"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "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": "c98cee3648fb0e4f5c3bb7c2b1da3e20ca7e7e2eb1b0ce7be30eddf633f90082"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_institutional": {"database": "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": "b2bd57c8ed6bee3b78a52d8e4b91d497cdaadfea467133ab99a8a7f27777cc28"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_professional": {"database": "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": "db156946a2864c1e5b0d0da91e11bfca8aa2760f69a0ef228822d988dd61d724"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "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": "2ca7c96de21f1b710a6b9ba70ab983a288358848c3d9ecd9f8680f76588bd003"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "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": "271f8251c805ebfc5af31c5f6e4111d708b0eaed7ce2ec0150f564f7c1e6755a"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0311046, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "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": "c2a737cf0f507a4a40c51a99081869973c4851fea6d1fc3782b01c38f5c4f542"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "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": "a592e61b8f53a343598818406ebe287bcde9e4a8f8010338609aa665f0c78bb5"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "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": "83bd3b9d1cd9992a17dde421e1931d5ddf4e9fe54bcb79cfd9a598f1a11a0993"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "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": "96702274d88d55823664b3fbcff62cdbef1f8e45a7ae67c4e780292a1929b2a1"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "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": "ea46843b3d941e271446af07da269bee8c17e7ff5fb9b86ea3dd9abc96e48760"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0469646, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "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": "33996450b63c81fc536050cba2205c4840df13237e9373e2d50db4d5d167e73e"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "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": "73e8439742c3df29c376c9a1eade516ae12381fd4fb99670f2cd856ca7127d67"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "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": "5d8c59578ab9b16efdaa30071f836f31bd773750ae05c74dcb332cabd33476ea"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "service_category__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.service_category__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "staging", "service_category__stg_medical_claim"], "alias": "service_category__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "2965d28559d54346b2cd74e9da52a2f032c2cc203edaf96744344924335b1235"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "group": null, "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": 1695044213.0625806, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model displays the contributing demographic and disease risk factors, interactions, and HCCs for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.0797164, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_factors", "package": null, "version": null}, {"name": "cms_hcc__int_enrollment_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disabled_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_count_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:22' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "raw_risk_score": {"name": "raw_risk_score", "description": "The sum of all patient risk factors.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "payment_risk_score": {"name": "payment_risk_score", "description": "The normalized risk score multiplied by the MA coding pattern adjustment factor for the corresponding HCC model version and payment years rate announcement from CMS.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.0797164, "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": [{"name": "cms_hcc__adjustment_rates", "package": null, "version": null}, {"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_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-20 08:50:22' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic and enrollment risk relative factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_members", "package": null, "version": null}, {"name": "cms_hcc__demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:20' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disabled and disease interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disabled_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:21' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factor values for every enrollee's final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:21' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factor values for final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.094723, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:21' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Conditions from eligible risk-adjustable claims per claim type for the collection year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__stg_medical_claim", "package": null, "version": null}, {"name": "cms_hcc__stg_core__condition", "package": null, "version": null}, {"name": "cms_hcc__cpt_hcpcs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 08:50:21' 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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__enrollment_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:20' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Final payment-eligible HCC count factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__payment_hcc_count_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric", "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-20 08:50:21' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "HCC hierarchy for the corresponding HCC model version and payment year applied to the mapped payment-eligible HCCs.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1105793, "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": [{"name": "cms_hcc__int_hcc_mapping", "package": null, "version": null}, {"name": "cms_hcc__disease_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "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-20 08:50:21' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Eligible conditions mapped to HCC codes for the corresponding HCC model version and payment year\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1264944, "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": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}, {"name": "cms_hcc__icd_10_cm_mappings", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "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-20 08:50:21' 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_members": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Transformed eligibility data into the demographic risk segments required for the CMS HCC and risk calculations.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input field was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_calculated": {"name": "date_calculated", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.1264944, "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": [{"name": "cms_hcc__stg_eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+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-20 08:50:19' 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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.1264944, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.142333, "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": [{"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.142333, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique encounter_id for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Reported date in when the condition began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date in which the condition was resolved.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.1581397, "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": [{"name": "core__stg_claims_condition", "package": null, "version": null}, {"name": "core__stg_clinical_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__condition.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_claims_condition\nunion all\nselect * from tuva.core._stg_clinical_condition\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__eligibility": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.1581397, "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": [{"name": "core__stg_claims_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__encounter": {"database": "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": "fdcb9a40f227bf4cdad6aec9e5697db02ee3e64eda31110e1a9c06a412f6185d"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code relevant to the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.1798887, "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": [{"name": "core__stg_clinical_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__lab_result": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.1798887, "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": [{"name": "core__stg_clinical_lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_clinical_lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__location": {"database": "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": "978a0da0c66bbea4fd6018afdebb6ca1dd8e3d47d0dcab69f1cc72d9356f52b9"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.1898947, "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": [{"name": "core__stg_claims_location", "package": null, "version": null}, {"name": "core__stg_clinical_location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__location.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_location\nunion all\nselect * from tuva.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medical_claim": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.206001, "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": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medication": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.206001, "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": [{"name": "core__stg_clinical_medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medication.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_clinical_medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__observation": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "Core encounter table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.206001, "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": [{"name": "core__stg_clinical_observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__observation.sql", "compiled": true, "compiled_code": "\n\n\nselect * from tuva.core._stg_clinical_observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__patient": {"database": "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": "a66973783354be761131b8742966bf7655b486e3e75b1f1c298bec92c348f49a"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.206001, "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": [{"name": "core__stg_claims_patient", "package": null, "version": null}, {"name": "core__stg_clinical_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__patient.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_patient\nunion all\nselect * from tuva.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__pharmacy_claim": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.224983, "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": [{"name": "core__stg_claims_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__practitioner": {"database": "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": "dc5b35a5bbe081c71df40883440b3b6eb12bc8d7fead93c496176c6e50da8ac8"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.224983, "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": [{"name": "core__stg_claims_practitioner", "package": null, "version": null}, {"name": "core__stg_clinical_practitioner", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__practitioner.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_practitioner\nunion all\nselect * from tuva.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__procedure": {"database": "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": "a88b9caf3980e1ee823faa433af0c5947ef0f37507508f67b22190afbf349dd8"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.2410269, "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": [{"name": "core__stg_claims_procedure", "package": null, "version": null}, {"name": "core__stg_clinical_procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect * from tuva.core._stg_claims_procedure\nunion all\nselect * from tuva.core._stg_clinical_procedure\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_condition": {"database": "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": "3dc368f8772805086d66933a84c55ad1c32b012b1d271647513faadfe5a59e51"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Date in which the condition occured.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2798753, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_data_for_medical_claims", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "62b901a3441145de93eb0a160edc89cb3cf8331cd836cf580494709c3222a949"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2889764, "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": [{"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "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": "1916301fc161277fa3553c65e7e905b263fc07b18a3c1738e96ea875f521c2a6"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Type of encounter.", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The pay date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the encounter by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2566528, "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": [{"name": "acute_inpatient__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.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-20 12:50:16.377540+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.claims_preprocessing.acute_inpatient_summary", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_location": {"database": "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": "fe01330ed0ca7c6bb2c2f968e49f98e44aad07d91ff671584e97883e78b4b143"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Core patient table", "columns": {}, "meta": {}, "group": null, "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": 1695044213.2566528, "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": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.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-20 12:50:16.377540+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "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": "5c2fc14fdc3e2972c6db2f484db5679ce219ba91f1a2f0cdff64529a8a6bd163"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "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, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.2566528, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "service_category__service_category_grouper", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "b95fb7b68d3df37c1a2463671a82a654a41aac724075ebce9e7b9877696991ca"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2727823, "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": [{"name": "eligibility", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as TIMESTAMP) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "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": "39ae6f5ba45cc246948701480a7125ab5f2d720417a81465b8de8dc18e739367"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.2889764, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "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": "33427bfc35eeffea472cef0d83719227837f98bbfd8de6e16981ceb1348030f8"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "entity_type_code": {"name": "entity_type_code", "description": "Code that describes the type of provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "entity_type_description": {"name": "entity_type_description", "description": "Description of the type of provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_taxonomy_code": {"name": "primary_taxonomy_code", "description": "Code corresponding to the primary specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_specialty_description": {"name": "primary_specialty_description", "description": "Description of the primary specialty for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_name": {"name": "provider_name", "description": "Name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_organization_name": {"name": "parent_organization_name", "description": "Name of the parent organization for the provider.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "practice_city": {"name": "practice_city", "description": "The city where the provider is located.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_state": {"name": "practice_state", "description": "The state where the provider is located.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_zip_code": {"name": "practice_zip_code", "description": "The zip code for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_updated": {"name": "last_updated", "description": "Date when the data for this provider was last updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deactivation_date": {"name": "deactivation_date", "description": "Date when this NPI was deactivated if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deactivation_flag": {"name": "deactivation_flag", "description": "Flag indicating if this NPI was deactivated.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.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-20 12:50:16.377540+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "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": "b687769a37ae3cce332211c16cf2635665b1b4c16ba5ef556704da0c7b09c56f"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "Type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.2798753, "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": [{"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "acute_inpatient__encounter_data_for_medical_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3048425, "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": [{"name": "lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_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.test.lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_location": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.location", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "practitioner", "package": null, "version": null}], "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.test.practitioner", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.3214545, "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": [{"name": "procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.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.test.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__claim_categorization": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__claim_categorization", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\data_quality\\ed_classification__claim_categorization.sql", "original_file_path": "models\\ed_classification\\data_quality\\ed_classification__claim_categorization.sql", "unique_id": "model.the_tuva_project.ed_classification__claim_categorization", "fqn": ["the_tuva_project", "ed_classification", "data_quality", "ed_classification__claim_categorization"], "alias": "_int_claim_categorization", "checksum": {"name": "sha256", "checksum": "4f7f52b9325a2aa150f6d3a2731a68448059c6f13fbd78f5e3cb9c17c249282f"}, "config": {"enabled": true, "alias": "_int_claim_categorization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "For all condition rows associated with ED claims, perform a crosstab against\nthe service category to double check that they really are mostly outpatient ED claims.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_claim_categorization", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3848827, "relation_name": "tuva.ed_classification._int_claim_categorization", "raw_code": "/*\r\nHighlights any lack of alignment between the ED records being used\r\nfor ED classification and the service category fields.\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n service_category_1\r\n , service_category_2\r\n , count(*) as condition_count\r\n\r\nfrom {{ ref('ed_classification__int_condition_with_claim') }}\r\ngroup by service_category_1, service_category_2\r\norder by count(*) desc", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\data_quality\\ed_classification__claim_categorization.sql", "compiled": true, "compiled_code": "/*\nHighlights any lack of alignment between the ED records being used\nfor ED classification and the service category fields.\n*/\n\n\n\nselect\n service_category_1\n , service_category_2\n , count(*) as condition_count\n\nfrom tuva.ed_classification._int_condition_with_claim\ngroup by service_category_1, service_category_2\norder by count(*) desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__unclassified_conditions": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__unclassified_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\data_quality\\ed_classification__unclassified_conditions.sql", "original_file_path": "models\\ed_classification\\data_quality\\ed_classification__unclassified_conditions.sql", "unique_id": "model.the_tuva_project.ed_classification__unclassified_conditions", "fqn": ["the_tuva_project", "ed_classification", "data_quality", "ed_classification__unclassified_conditions"], "alias": "_int_unclassified_conditions", "checksum": {"name": "sha256", "checksum": "8b4eb15e8565d90b3892360b2eb59febcb572e96e16fe223c3036b8b8c4ed89a"}, "config": {"enabled": true, "alias": "_int_unclassified_conditions", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "CCS Level Breakdown of the conditions table augmented with the probabilistic\nclassification flags. Includes statistics about the codes and conditions\nthat could not be classified using the ED Classification algorithm.\n", "columns": {"ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "CCS Description for the ICD code in the discharge diagnosis of the conditions table augmented with COVID.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unique_codes_in_ccs_count": {"name": "unique_codes_in_ccs_count", "description": "Number of unique condition codes that fit into the CCS descrption", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unique_unclassified_codes_in_ccs_count": {"name": "unique_unclassified_codes_in_ccs_count", "description": "Number of the condition diagnoses in the CCS description", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_row_unclassified_percent": {"name": "condition_row_unclassified_percent", "description": "Percent of the discharge diagnosis condition rows that were not classifiable using the ED Classification algorithm. I.e. the rows with diagnosis codes that weren't assigned a ED classification probability, either because the code didn't exist the time the algorithm was created or something else.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unclassified_claim_paid_amount_sum": {"name": "unclassified_claim_paid_amount_sum", "description": "Total spend associated with unclassified ED claims", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_unclassified_conditions", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3848827, "relation_name": "tuva.ed_classification._int_unclassified_conditions", "raw_code": "/*\r\nCCS Level breakdown of condition diagnoses and statistics\r\non the number of codes and condition rows that could not\r\nbe classified using the johnston algorithm\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n ccs_description_with_covid\r\n , count(distinct(code)) as unique_codes_in_ccs_count\r\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\r\n , count(code) as condition_row_count\r\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\r\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\r\n\r\nfrom {{ ref('ed_classification__int_merge_condition') }}\r\ngroup by ccs_description_with_covid\r\norder by unclassified_claim_paid_amount_sum desc", "language": "sql", "refs": [{"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\data_quality\\ed_classification__unclassified_conditions.sql", "compiled": true, "compiled_code": "/*\nCCS Level breakdown of condition diagnoses and statistics\non the number of codes and condition rows that could not\nbe classified using the johnston algorithm\n*/\n\n\n\nselect\n ccs_description_with_covid\n , count(distinct(code)) as unique_codes_in_ccs_count\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\n , count(code) as condition_row_count\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\n\nfrom tuva.ed_classification._int_merge_condition\ngroup by ccs_description_with_covid\norder by unclassified_claim_paid_amount_sum desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__unclassified_rows": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__unclassified_rows", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\data_quality\\ed_classification__unclassified_rows.sql", "original_file_path": "models\\ed_classification\\data_quality\\ed_classification__unclassified_rows.sql", "unique_id": "model.the_tuva_project.ed_classification__unclassified_rows", "fqn": ["the_tuva_project", "ed_classification", "data_quality", "ed_classification__unclassified_rows"], "alias": "_int_unclassified_rows", "checksum": {"name": "sha256", "checksum": "d2f594c40bf8832f99b737396cb85244a03fdfad9d5f782ffc075906a6fc17a8"}, "config": {"enabled": true, "alias": "_int_unclassified_rows", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Overall unclassified rows stats.", "columns": {"condition_row_unclassified_percent": {"name": "condition_row_unclassified_percent", "description": "Percent of discharge condition rows that were not classifiable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_unclassified_rows", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3848827, "relation_name": "tuva.ed_classification._int_unclassified_rows", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n cast({{ date_part(\"year\", \"recorded_date\") }} as {{ dbt.type_string() }}) as recorded_date_year\r\n , count(distinct(code)) as unique_codes_in_ccs_count\r\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\r\n , count(code) as condition_row_count\r\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\r\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\r\n\r\nfrom {{ ref('ed_classification__int_merge_condition') }}\r\ngroup by recorded_date_year\r\norder by unclassified_claim_paid_amount_sum desc", "language": "sql", "refs": [{"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\data_quality\\ed_classification__unclassified_rows.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(date_part('year', recorded_date) as TEXT) as recorded_date_year\n , count(distinct(code)) as unique_codes_in_ccs_count\n , count(distinct(case when ed_classification_capture = 0 then code else null end)) as unique_unclassified_codes_in_ccs_count\n , count(code) as condition_row_count\n , (1 - avg(ed_classification_capture)) * 100 as condition_row_unclassified_percent\n , sum(case when ed_classification_capture = 0 then claim_paid_amount_sum else 0 end) as unclassified_claim_paid_amount_sum\n\nfrom tuva.ed_classification._int_merge_condition\ngroup by recorded_date_year\norder by unclassified_claim_paid_amount_sum desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__summary": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\final\\ed_classification__summary.sql", "original_file_path": "models\\ed_classification\\final\\ed_classification__summary.sql", "unique_id": "model.the_tuva_project.ed_classification__summary", "fqn": ["the_tuva_project", "ed_classification", "final", "ed_classification__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "00f47f14c7d48c7aa6e68a03b36bb32fe8555cd1abd9a6e9ce0242cd208107f5"}, "config": {"enabled": true, "alias": "summary", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED Classification as a cube that can be summarized\n", "columns": {"classification": {"name": "classification", "description": "ED classification categories", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifer for each claim", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date on which the condition was recorded", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The normalized condition code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "The normalized description of the condition code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "The condition category with covid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date_year": {"name": "recorded_date_year", "description": "The year of the condition recorded date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date_year_month": {"name": "recorded_date_year_month", "description": "The year and month of the condition recorded date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "The sum of the claim paid amount lines", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category the claim belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category the claim belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_parent_organization_name_with_provider_name": {"name": "provider_parent_organization_name_with_provider_name", "description": "The parent organization and provider name associate with the claim", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The provider first name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The provider last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_organization_name": {"name": "provider_organization_name", "description": "The provider organization", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_practice_state": {"name": "provider_practice_state", "description": "The provider practice state", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_practice_zip_code": {"name": "provider_practice_zip_code", "description": "The provider practice zip code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_gender": {"name": "patient_gender", "description": "The patient gender", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_birth_date": {"name": "patient_birth_date", "description": "The patient date of birth", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The patient age as of now", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "The patient race", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_state": {"name": "patient_state", "description": "The patient state", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "Human readable name of the classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "The order of the classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_column": {"name": "classification_column", "description": "A short hand name of the classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "summary", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3364599, "relation_name": "tuva.ed_classification.summary", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n *\r\nfrom {{ ref('ed_classification__int_condition_with_claim') }}\r\ninner join {{ ref('ed_classification__categories') }} using(classification)", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}, {"name": "ed_classification__categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "seed.the_tuva_project.ed_classification__categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\final\\ed_classification__summary.sql", "compiled": true, "compiled_code": "\n\nselect\n *\nfrom tuva.ed_classification._int_condition_with_claim\ninner join tuva.ed_classification._value_set_categories using(classification)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_ccs_description": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_ccs_description", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_ccs_description.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_ccs_description.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_ccs_description", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_ccs_description"], "alias": "_int_by_ccs_description", "checksum": {"name": "sha256", "checksum": "400b72e1aa00aa51d05f39d313207b694c2ffcae4f366839ddf2aaf6c52dc27b"}, "config": {"enabled": true, "alias": "_int_by_ccs_description", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_ccs_description", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3364599, "relation_name": "tuva.ed_classification._int_by_ccs_description", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , ccs_description_with_covid\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, ccs_description_with_covid\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\n\r\nselect\r\n summary.*\r\n ,claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_ccs_description.sql", "compiled": true, "compiled_code": "\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , ccs_description_with_covid\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, ccs_description_with_covid\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\n\nselect\n summary.*\n ,claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_patient_race": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_patient_race", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_patient_race.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_patient_race.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_patient_race", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_patient_race"], "alias": "_int_by_patient_race", "checksum": {"name": "sha256", "checksum": "62fe3c2df18b4c9b47fa9f05cde3fab19befe0166a3a9236975f63c43618f6eb"}, "config": {"enabled": true, "alias": "_int_by_patient_race", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_patient_race", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3364599, "relation_name": "tuva.ed_classification._int_by_patient_race", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , patient_race\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, patient_race\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\n\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_patient_race.sql", "compiled": true, "compiled_code": "\n\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , patient_race\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, patient_race\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\n\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_provider_parent_organization": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_provider_parent_organization", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_provider_parent_organization.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_provider_parent_organization.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_parent_organization", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_provider_parent_organization"], "alias": "_int_by_provider_parent_organization", "checksum": {"name": "sha256", "checksum": "7c9f8d53ee9872970f5e91336757e0b2f7580580fe259585c4d8dac95fe5fc11"}, "config": {"enabled": true, "alias": "_int_by_provider_parent_organization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_parent_organization_with_provider_name": {"name": "provider_parent_organization_with_provider_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_provider_parent_organization", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_provider_parent_organization", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , provider_parent_organization_name_with_provider_name\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, provider_parent_organization_name_with_provider_name\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_provider_parent_organization.sql", "compiled": true, "compiled_code": "\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , provider_parent_organization_name_with_provider_name\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, provider_parent_organization_name_with_provider_name\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_provider_practice_state": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_provider_practice_state", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_provider_practice_state.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_provider_practice_state.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_practice_state", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_provider_practice_state"], "alias": "_int_by_provider_practice_state", "checksum": {"name": "sha256", "checksum": "6e5cf37a80527f9722c5178ce51fe5f1f431f9064a96e8f059a0ae8c9a5df071"}, "config": {"enabled": true, "alias": "_int_by_provider_practice_state", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year, and ccs_description", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_practice_state": {"name": "provider_practice_state", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_provider_practice_state", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_provider_practice_state", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , provider_practice_state\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, provider_practice_state\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by percent_claim_paid_amount_sum_of_classification desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_provider_practice_state.sql", "compiled": true, "compiled_code": "\n\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , provider_practice_state\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, provider_practice_state\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by percent_claim_paid_amount_sum_of_classification desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_year": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_year", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_year.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_year.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_year", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_year"], "alias": "_int_by_year", "checksum": {"name": "sha256", "checksum": "82f7535173f1c48130b8b43e563698b5711272c883c2a4897baf9bbe711ef4e7"}, "config": {"enabled": true, "alias": "_int_by_year", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year": {"name": "condition_date_year", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_year", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_year", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\nfrom {{ ref('ed_classification__summary') }}\r\ngroup by classification_order, classification_name, recorded_date_year\r\norder by recorded_date_year, classification_order", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_year.sql", "compiled": true, "compiled_code": "\n\nselect\n classification_order\n , classification_name\n , recorded_date_year\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\nfrom tuva.ed_classification.summary\ngroup by classification_order, classification_name, recorded_date_year\norder by recorded_date_year, classification_order", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_by_year_month": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_by_year_month", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_by_year_month.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_by_year_month.sql", "unique_id": "model.the_tuva_project.ed_classification__int_by_year_month", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_by_year_month"], "alias": "_int_by_year_month", "checksum": {"name": "sha256", "checksum": "3e92e01f247b8ae5c5649c30956558748543a6a3eb82fc54384c4591d052e066"}, "config": {"enabled": true, "alias": "_int_by_year_month", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED_Summary aggregated by year month", "columns": {"classification_order": {"name": "classification_order", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date_year_month": {"name": "condition_date_year_month", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_count": {"name": "claim_count", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_paid_amount_sum": {"name": "claim_paid_amount_sum", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_year_month", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3558004, "relation_name": "tuva.ed_classification._int_by_year_month", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nwith summary as (\r\n select\r\n classification_order\r\n , classification_name\r\n , recorded_date_year\r\n , recorded_date_year_month\r\n , count(distinct(claim_id)) as claim_count\r\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__summary') }}\r\n group by classification_order, classification_name, recorded_date_year, recorded_date_year_month\r\n)\r\n, totals_by_classification as (\r\n select\r\n classification_name\r\n , count(distinct(claim_id)) as total_claim_count\r\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\r\n from {{ ref('ed_classification__summary') }}\r\n group by\r\n classification_name\r\n)\r\nselect\r\n summary.*\r\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\r\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\r\nfrom summary\r\ninner join totals_by_classification class\r\n on summary.classification_name = class.classification_name\r\norder by classification_order, recorded_date_year_month desc", "language": "sql", "refs": [{"name": "ed_classification__summary", "package": null, "version": null}, {"name": "ed_classification__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_by_year_month.sql", "compiled": true, "compiled_code": "\nwith summary as (\n select\n classification_order\n , classification_name\n , recorded_date_year\n , recorded_date_year_month\n , count(distinct(claim_id)) as claim_count\n , sum(claim_paid_amount_sum) as claim_paid_amount_sum\n from tuva.ed_classification.summary\n group by classification_order, classification_name, recorded_date_year, recorded_date_year_month\n)\n, totals_by_classification as (\n select\n classification_name\n , count(distinct(claim_id)) as total_claim_count\n , sum(claim_paid_amount_sum) as total_claim_paid_amount\n from tuva.ed_classification.summary\n group by\n classification_name\n)\nselect\n summary.*\n , claim_count/total_claim_count * 100 as percent_claim_count_of_classification\n , claim_paid_amount_sum/total_claim_paid_amount * 100 as percent_claim_paid_amount_sum_of_classification\nfrom summary\ninner join totals_by_classification class\n on summary.classification_name = class.classification_name\norder by classification_order, recorded_date_year_month desc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_condition_with_claim": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_condition_with_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_condition_with_claim.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_condition_with_claim.sql", "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_claim", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_condition_with_claim"], "alias": "_int_condition_with_claim", "checksum": {"name": "sha256", "checksum": "615a40ee5eecd7bc88417550d053cce47443ae5a45d6760e8c7151ce0c900ece"}, "config": {"enabled": true, "alias": "_int_condition_with_claim", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filtered condition row table to classified ones. Includes additional\ninformation from the claim header, provider and patient tables\n", "columns": {"claim_id": {"name": "claim_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_condition_with_claim", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_condition_with_claim", "raw_code": "/*\r\nDenormalized view of each condition row with additional provider and patient level\r\ninformation merged on based on the header level detail on the claim\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith deduped_claims as (\r\n select distinct\r\n claim_id\r\n , claim_line_end_date\r\n , service_category_1\r\n , service_category_2\r\n , facility_npi\r\n , billing_npi\r\n , patient_id\r\n from {{ ref('ed_classification__stg_medical_claim') }} mc\r\n where mc.claim_line_number = 1\r\n)\r\n, deduped_providers as (\r\n select distinct\r\n npi\r\n , entity_type_code\r\n , entity_type_description\r\n , primary_taxonomy_code\r\n , primary_specialty_description\r\n , provider_first_name\r\n , provider_last_name\r\n , provider_organization_name\r\n , parent_organization_name\r\n , practice_city\r\n , practice_state\r\n , practice_zip_code\r\n from {{ ref('terminology__provider') }}\r\n)\r\n\r\nselect\r\n c.claim_id\r\n , c.patient_id\r\n , c.recorded_date\r\n , c.code\r\n , c.description\r\n , c.ccs_description_with_covid\r\n , c.recorded_date_year\r\n , c.recorded_date_year_month\r\n , c.claim_paid_amount_sum\r\n , c.classification\r\n -- claim level additions\r\n , mc.service_category_1\r\n , mc.service_category_2\r\n -- provider level additions\r\n , coalesce(fp.parent_organization_name\r\n , bp.parent_organization_name\r\n , fp.provider_first_name||' '||fp.provider_last_name\r\n , bp.provider_first_name||' '||bp.provider_last_name\r\n , fp.provider_organization_name\r\n , bp.provider_organization_name) as provider_parent_organization_name_with_provider_name\r\n , coalesce(fp.provider_first_name, bp.provider_first_name) as provider_first_name\r\n , coalesce(fp.provider_last_name, bp.provider_last_name) as provider_last_name\r\n , coalesce(fp.provider_organization_name, bp.provider_organization_name) as provider_organization_name\r\n , coalesce(fp.parent_organization_name, bp.parent_organization_name) as provider_parent_organization_name\r\n , coalesce(fp.practice_state, bp.practice_state) as provider_practice_state\r\n , coalesce(fp.practice_zip_code, bp.practice_zip_code) as provider_practice_zip_code\r\n -- patient level additions\r\n , p.sex as patient_gender\r\n , p.birth_date as patient_birth_date\r\n , floor({{ datediff('birth_date', 'current_date', 'hour') }} / 8766.0) as patient_age\r\n , p.race as patient_race\r\n , p.state as patient_state\r\n\r\nfrom {{ ref('ed_classification__int_condition_with_class') }} c\r\ninner join deduped_claims mc\r\n on c.claim_id = mc.claim_id\r\n and c.recorded_date = mc.claim_line_end_date\r\nleft join deduped_providers fp on mc.facility_npi = fp.npi\r\nleft join deduped_providers bp on mc.billing_npi = bp.npi\r\nleft join {{ ref('ed_classification__stg_patient') }} p on mc.patient_id = p.patient_id", "language": "sql", "refs": [{"name": "ed_classification__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "ed_classification__int_condition_with_class", "package": null, "version": null}, {"name": "ed_classification__stg_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ed_classification__stg_medical_claim", "seed.the_tuva_project.terminology__provider", "model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_condition_with_claim.sql", "compiled": true, "compiled_code": "/*\nDenormalized view of each condition row with additional provider and patient level\ninformation merged on based on the header level detail on the claim\n*/\n\n\n\nwith __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n), __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n),deduped_claims as (\n select distinct\n claim_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , facility_npi\n , billing_npi\n , patient_id\n from __dbt__cte__ed_classification__stg_medical_claim mc\n where mc.claim_line_number = 1\n)\n, deduped_providers as (\n select distinct\n npi\n , entity_type_code\n , entity_type_description\n , primary_taxonomy_code\n , primary_specialty_description\n , provider_first_name\n , provider_last_name\n , provider_organization_name\n , parent_organization_name\n , practice_city\n , practice_state\n , practice_zip_code\n from tuva.terminology.provider\n)\n\nselect\n c.claim_id\n , c.patient_id\n , c.recorded_date\n , c.code\n , c.description\n , c.ccs_description_with_covid\n , c.recorded_date_year\n , c.recorded_date_year_month\n , c.claim_paid_amount_sum\n , c.classification\n -- claim level additions\n , mc.service_category_1\n , mc.service_category_2\n -- provider level additions\n , coalesce(fp.parent_organization_name\n , bp.parent_organization_name\n , fp.provider_first_name||' '||fp.provider_last_name\n , bp.provider_first_name||' '||bp.provider_last_name\n , fp.provider_organization_name\n , bp.provider_organization_name) as provider_parent_organization_name_with_provider_name\n , coalesce(fp.provider_first_name, bp.provider_first_name) as provider_first_name\n , coalesce(fp.provider_last_name, bp.provider_last_name) as provider_last_name\n , coalesce(fp.provider_organization_name, bp.provider_organization_name) as provider_organization_name\n , coalesce(fp.parent_organization_name, bp.parent_organization_name) as provider_parent_organization_name\n , coalesce(fp.practice_state, bp.practice_state) as provider_practice_state\n , coalesce(fp.practice_zip_code, bp.practice_zip_code) as provider_practice_zip_code\n -- patient level additions\n , p.sex as patient_gender\n , p.birth_date as patient_birth_date\n , floor(datediff(\n hour,\n birth_date,\n current_date\n ) / 8766.0) as patient_age\n , p.race as patient_race\n , p.state as patient_state\n\nfrom tuva.ed_classification._int_condition_with_class c\ninner join deduped_claims mc\n on c.claim_id = mc.claim_id\n and c.recorded_date = mc.claim_line_end_date\nleft join deduped_providers fp on mc.facility_npi = fp.npi\nleft join deduped_providers bp on mc.billing_npi = bp.npi\nleft join __dbt__cte__ed_classification__stg_patient p on mc.patient_id = p.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_medical_claim", "sql": " __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n)"}, {"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_condition_with_class": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_condition_with_class", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_condition_with_class.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_condition_with_class.sql", "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_class", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_condition_with_class"], "alias": "_int_condition_with_class", "checksum": {"name": "sha256", "checksum": "f87662ccd62983cf740426e24fa5f43b6a263d8dad5870ed1de752c285821aa6"}, "config": {"enabled": true, "alias": "_int_condition_with_class", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filtered condition row table to classified ones.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_condition_with_class", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_condition_with_class", "raw_code": "/*\r\nFilter conditions to those that were classified and pick the classification\r\nwith the greatest probability (that's the greatest logic). This logic removes\r\nany rows that were not classified.\r\n*/\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n a.encounter_id\r\n , a.claim_id\r\n , a.patient_id\r\n , a.code_type\r\n , a.code\r\n , a.description\r\n , a.ccs_description_with_covid\r\n , a.recorded_date\r\n , cast({{ date_part(\"year\", \"recorded_date\") }} as {{ dbt.type_string() }}) as recorded_date_year\r\n , cast({{ date_part(\"year\", \"recorded_date\") }} as {{ dbt.type_string() }})\r\n || lpad(cast({{ date_part(\"month\", \"recorded_date\") }} as {{ dbt.type_string() }}), 2, '0')\r\n as recorded_date_year_month\r\n , a.claim_paid_amount_sum\r\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\r\n when edcnnpa then 'edcnnpa'\r\n when edcnpa then 'edcnpa'\r\n when epct then 'epct'\r\n when noner then 'noner'\r\n when injury then 'injury'\r\n when psych then 'psych'\r\n when alcohol then 'alcohol'\r\n when drug then 'drug'\r\n else 'unclassified'\r\n end as classification\r\nfrom {{ ref('ed_classification__int_merge_condition') }} a\r\nwhere ed_classification_capture = 1", "language": "sql", "refs": [{"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_condition_with_class.sql", "compiled": true, "compiled_code": "/*\nFilter conditions to those that were classified and pick the classification\nwith the greatest probability (that's the greatest logic). This logic removes\nany rows that were not classified.\n*/\n\n\nselect\n a.encounter_id\n , a.claim_id\n , a.patient_id\n , a.code_type\n , a.code\n , a.description\n , a.ccs_description_with_covid\n , a.recorded_date\n , cast(date_part('year', recorded_date) as TEXT) as recorded_date_year\n , cast(date_part('year', recorded_date) as TEXT)\n || lpad(cast(date_part('month', recorded_date) as TEXT), 2, '0')\n as recorded_date_year_month\n , a.claim_paid_amount_sum\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\n when edcnnpa then 'edcnnpa'\n when edcnpa then 'edcnpa'\n when epct then 'epct'\n when noner then 'noner'\n when injury then 'injury'\n when psych then 'psych'\n when alcohol then 'alcohol'\n when drug then 'drug'\n else 'unclassified'\n end as classification\nfrom tuva.ed_classification._int_merge_condition a\nwhere ed_classification_capture = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_merge_condition": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_merge_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_merge_condition.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_merge_condition.sql", "unique_id": "model.the_tuva_project.ed_classification__int_merge_condition", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_merge_condition"], "alias": "_int_merge_condition", "checksum": {"name": "sha256", "checksum": "579e75decf752826252bce468fc0b2df6be15f8e5eefa50ea84f4e07db7dbdf2"}, "config": {"enabled": true, "alias": "_int_merge_condition", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "All conditions with the classifications merged on and resolved to a single\ncategory per condition row.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_merge_condition", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_merge_condition", "raw_code": "/*\r\nAll condition discharge diagnosis left join with probabilistic\r\nindicators of ED classification terminology\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n{% set colnames = [\"edcnnpa\", \"edcnpa\", \"epct\", \"noner\", \"injury\", \"psych\", \"alcohol\", \"drug\"] %}\r\n\r\nwith condition as (\r\nselect * from {{ ref('ed_classification__int_primary_dx_per_claim') }}\r\n)\r\n, icd9 as (\r\n select\r\n icd9 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd9') }}\r\n)\r\n, icd10 as (\r\n select\r\n icd10 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd10') }}\r\n)\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd10.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\r\nfrom condition a\r\nleft join icd10\r\non a.code = icd10.code and a.code_type = 'icd-10-cm'\r\nunion all\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd9.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\r\nfrom condition a\r\ninner join icd9\r\non a.code = icd9.code and a.code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "ed_classification__int_primary_dx_per_claim", "package": null, "version": null}, {"name": "ed_classification__johnston_icd9", "package": null, "version": null}, {"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim", "seed.the_tuva_project.ed_classification__johnston_icd9", "seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_merge_condition.sql", "compiled": true, "compiled_code": "/*\nAll condition discharge diagnosis left join with probabilistic\nindicators of ED classification terminology\n*/\n\n\n\n\nwith condition as (\nselect * from tuva.ed_classification._int_primary_dx_per_claim\n)\n, icd9 as (\n select\n icd9 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from tuva.ed_classification._value_set_johnston_icd9\n)\n, icd10 as (\n select\n icd10 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from tuva.ed_classification._value_set_johnston_icd10\n)\n\nselect\n a.*\n \n , icd10.edcnnpa\n \n , icd10.edcnpa\n \n , icd10.epct\n \n , icd10.noner\n \n , icd10.injury\n \n , icd10.psych\n \n , icd10.alcohol\n \n , icd10.drug\n \n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\nfrom condition a\nleft join icd10\non a.code = icd10.code and a.code_type = 'icd-10-cm'\nunion all\nselect\n a.*\n \n , icd9.edcnnpa\n \n , icd9.edcnpa\n \n , icd9.epct\n \n , icd9.noner\n \n , icd9.injury\n \n , icd9.psych\n \n , icd9.alcohol\n \n , icd9.drug\n \n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\nfrom condition a\ninner join icd9\non a.code = icd9.code and a.code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_patient_list": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_patient_list", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_patient_list.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_patient_list.sql", "unique_id": "model.the_tuva_project.ed_classification__int_patient_list", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_patient_list"], "alias": "_int_patient_list", "checksum": {"name": "sha256", "checksum": "d31576b976fcccb7ca171c09ccf6767c4c2f612d37877d69d48d1d704ef50677"}, "config": {"enabled": true, "alias": "_int_patient_list", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED condition rows with all available patient information joined in.\nUseful for identifying patients who have more than a certain number\nof ED visits per time period.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_patient_list", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3678057, "relation_name": "tuva.ed_classification._int_patient_list", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nselect\r\n p.*\r\n , c.claim_id\r\n , c.recorded_date\r\n , c.recorded_date_year\r\n , c.recorded_date_year_month\r\n , c.code_type\r\n , c.code\r\n , c.description\r\n , c.ccs_description_with_covid\r\n , ec.classification_order\r\n , c.classification\r\n , ec.classification_name\r\nfrom {{ ref('ed_classification__int_condition_with_class') }} c\r\ninner join {{ ref('ed_classification__stg_patient') }} p using(patient_id)\r\ninner join {{ ref('ed_classification__categories') }} ec using(classification)", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_class", "package": null, "version": null}, {"name": "ed_classification__stg_patient", "package": null, "version": null}, {"name": "ed_classification__categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_patient_list.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n)select\n p.*\n , c.claim_id\n , c.recorded_date\n , c.recorded_date_year\n , c.recorded_date_year_month\n , c.code_type\n , c.code\n , c.description\n , c.ccs_description_with_covid\n , ec.classification_order\n , c.classification\n , ec.classification_name\nfrom tuva.ed_classification._int_condition_with_class c\ninner join __dbt__cte__ed_classification__stg_patient p using(patient_id)\ninner join tuva.ed_classification._value_set_categories ec using(classification)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__int_primary_dx_per_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_primary_dx_per_claim.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_primary_dx_per_claim.sql", "unique_id": "model.the_tuva_project.ed_classification__int_primary_dx_per_claim", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_primary_dx_per_claim"], "alias": "_int_primary_dx_per_claim", "checksum": {"name": "sha256", "checksum": "1aef126a28d5eb4eee9e4ea5c8db8fbe8e459abdb188ee430f0607af0c53bee8"}, "config": {"enabled": true, "alias": "_int_primary_dx_per_claim", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED condition rows with all available patient information joined in.\nUseful for identifying patients who have more than a certain number\nof ED visits per time period.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_primary_dx_per_claim", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1695044213.3798127, "relation_name": "tuva.ed_classification._int_primary_dx_per_claim", "raw_code": "/*\r\nStaging model for the input layer:\r\nThis contains one row for every unique primary discharge diagnosis in the dataset.\r\nThis is also filtered to ED claims.\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith ed_claims as (\r\n select\r\n claim_id\r\n , sum(med.paid_amount) as claim_paid_amount_sum\r\n from {{ ref('ed_classification__stg_medical_claim') }} med\r\n left join {{ ref('ed_classification__stg_encounter') }} enc\r\n on med.encounter_id = enc.encounter_id\r\n where (place_of_service_code = '23' or revenue_center_code in ('0450', '0451', '0452', '0456', '0459', '0981'))\r\n and (encounter_type <> 'acute inpatient' or encounter_type is null)\r\n group by claim_id\r\n)\r\n\r\nselect\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 , cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(normalized_code_type as {{ dbt.type_string() }}) as code_type\r\n , cast(normalized_code as {{ dbt.type_string() }}) as code\r\n , cast(condition.normalized_description as {{ dbt.type_string() }}) as description\r\n , cast(case\r\n when lower(condition.normalized_description) like '%covid%'\r\n then condition.normalized_description\r\n else mapping.ccs_description\r\n end\r\n as {{ dbt.type_string() }}) as ccs_description_with_covid\r\n , recorded_date\r\n , cast(claim_paid_amount_sum as {{ dbt.type_float() }}) as claim_paid_amount_sum\r\nfrom {{ ref('ed_classification__stg_condition') }} condition\r\ninner join ed_claims using(claim_id)\r\nleft join {{ ref('ed_classification__icd_10_cm_to_ccs') }} mapping \r\non condition.normalized_code = mapping.icd_10_cm\r\nwhere condition_rank = 1", "language": "sql", "refs": [{"name": "ed_classification__stg_medical_claim", "package": null, "version": null}, {"name": "ed_classification__stg_encounter", "package": null, "version": null}, {"name": "ed_classification__stg_condition", "package": null, "version": null}, {"name": "ed_classification__icd_10_cm_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float"], "nodes": ["model.the_tuva_project.ed_classification__stg_medical_claim", "model.the_tuva_project.ed_classification__stg_encounter", "model.the_tuva_project.ed_classification__stg_condition", "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_primary_dx_per_claim.sql", "compiled": true, "compiled_code": "/*\nStaging model for the input layer:\nThis contains one row for every unique primary discharge diagnosis in the dataset.\nThis is also filtered to ED claims.\n*/\n\n\n\nwith __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n), __dbt__cte__ed_classification__stg_encounter as (\nselect\n encounter_id\n , encounter_type\nfrom tuva.core.encounter\n),ed_claims as (\n select\n claim_id\n , sum(med.paid_amount) as claim_paid_amount_sum\n from __dbt__cte__ed_classification__stg_medical_claim med\n left join __dbt__cte__ed_classification__stg_encounter enc\n on med.encounter_id = enc.encounter_id\n where (place_of_service_code = '23' or revenue_center_code in ('0450', '0451', '0452', '0456', '0459', '0981'))\n and (encounter_type <> 'acute inpatient' or encounter_type is null)\n group by claim_id\n)\n\nselect\n cast(encounter_id as TEXT) as encounter_id\n , cast(claim_id as TEXT) as claim_id\n , cast(patient_id as TEXT) as patient_id\n , cast(normalized_code_type as TEXT) as code_type\n , cast(normalized_code as TEXT) as code\n , cast(condition.normalized_description as TEXT) as description\n , cast(case\n when lower(condition.normalized_description) like '%covid%'\n then condition.normalized_description\n else mapping.ccs_description\n end\n as TEXT) as ccs_description_with_covid\n , recorded_date\n , cast(claim_paid_amount_sum as FLOAT) as claim_paid_amount_sum\nfrom tuva.ed_classification.ed_classification__stg_condition condition\ninner join ed_claims using(claim_id)\nleft join tuva.ed_classification._value_set_icd_10_cm_to_ccs mapping \non condition.normalized_code = mapping.icd_10_cm\nwhere condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_medical_claim", "sql": " __dbt__cte__ed_classification__stg_medical_claim as (\nselect\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim\n)"}, {"id": "model.the_tuva_project.ed_classification__stg_encounter", "sql": " __dbt__cte__ed_classification__stg_encounter as (\nselect\n encounter_id\n , encounter_type\nfrom tuva.core.encounter\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_condition": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_condition.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_condition.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_condition", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_condition"], "alias": "ed_classification__stg_condition", "checksum": {"name": "sha256", "checksum": "3428386bd4e6edb1dee81ab1c9e4220ba526e07575737cd11b5f2ef1e5031427"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "bind": false}, "created_at": 1695044213.3798127, "relation_name": "tuva.ed_classification.ed_classification__stg_condition", "raw_code": "select\r\n claim_id\r\n , patient_id\r\n , encounter_id\r\n , recorded_date\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , condition_rank\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_condition.sql", "compiled": true, "compiled_code": "select\n claim_id\n , patient_id\n , encounter_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , normalized_description\n , condition_rank\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_encounter": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_encounter.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_encounter", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_encounter"], "alias": "ed_classification__stg_encounter", "checksum": {"name": "sha256", "checksum": "c3a5b8ec4d92bcfda383280fca59c983ac34ac0820d84badb369f3419b1aa160"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "bind": false}, "created_at": 1695044213.3848827, "relation_name": null, "raw_code": "select\r\n encounter_id\r\n , encounter_type\r\nfrom {{ ref('core__encounter') }}", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "compiled": true, "compiled_code": "select\n encounter_id\n , encounter_type\nfrom tuva.core.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_medical_claim": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_medical_claim.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_medical_claim", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_medical_claim"], "alias": "ed_classification__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "e67609ef6e42286545130b97c8a50692adee47894356dde99ac9f19cf98b85fe"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "bind": false}, "created_at": 1695044213.3848827, "relation_name": null, "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , encounter_id\r\n , patient_id\r\n , claim_line_end_date\r\n , service_category_1\r\n , service_category_2\r\n , place_of_service_code\r\n , revenue_center_code\r\n , billing_npi\r\n , facility_npi\r\n , paid_amount\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_medical_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , encounter_id\n , patient_id\n , claim_line_end_date\n , service_category_1\n , service_category_2\n , place_of_service_code\n , revenue_center_code\n , billing_npi\n , facility_npi\n , paid_amount\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_patient": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__stg_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_patient.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_patient", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_patient"], "alias": "ed_classification__stg_patient", "checksum": {"name": "sha256", "checksum": "923260a6034fff8dfe2880e7b6bdb39545c838b1a64aab3bb1895651179aff40"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "bind": false}, "created_at": 1695044213.3848827, "relation_name": null, "raw_code": "select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , race\r\n , state\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "compiled": true, "compiled_code": "select\n patient_id\n , sex\n , birth_date\n , race\n , state\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "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": "1c0fc013f1dc56626c276f1ab29b0ff9a5ee4a6a24220a18d0d43e3db0e6827e"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Creates member months from eligibility data", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "The payer covering the patient's eligibility", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4311867, "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": [{"name": "terminology__calendar", "package": null, "version": null}, {"name": "financial_pmpm__stg_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__stg_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4475298, "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": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm.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-20 12:50:16.377540+00:00' as tuva_last_run\nFROM tuva.financial_pmpm.pmpm_prep a\nGROUP BY 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes all the paid and allowed statistics for every patient_id and year_month combination. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4475298, "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": [{"name": "financial_pmpm__stg_member_months", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_allowed_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_allowed_pivot", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Adds service categories to claims and sums paid and allowed amounts to the year-month level.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__stg_medical_claim", "package": null, "version": null}, {"name": "financial_pmpm__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "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": "c2f75358acd58cf147e0d3be427ac89d48b8e856fe97a99d7c40c8c351b0d2d3"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "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": "a0db911502a08ce6bbb832549d4b5e55f9859c2e0698dcf6bea107b8c7054640"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.4625373, "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": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "tuva", "schema": "test", "name": "financial_pmpm__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_eligibility"], "alias": "financial_pmpm__stg_eligibility", "checksum": {"name": "sha256", "checksum": "bca6a11194db8df07465f3d4659e15c19c359607a83c4456ccb19a12b3003ee0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "core__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "tuva", "schema": "test", "name": "financial_pmpm__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_medical_claim"], "alias": "financial_pmpm__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "c388768c61e03729cddff1584573bef76c239a66824250b2c82fc21ca646ca88"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, claim_id\n, claim_line_number\n, claim_start_date\n, claim_end_date\n, service_category_1\n, service_category_2\n, paid_amount\n, allowed_amount\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_member_months": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "financial_pmpm__member_months", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.financial_pmpm.member_months", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "tuva", "schema": "test", "name": "financial_pmpm__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_pharmacy_claim"], "alias": "financial_pmpm__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "30a2cc87ca3fe2978c95d27531c380940217b319465b4a4e003a2fc137445351"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.4796398, "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": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, dispensing_date\n, paid_amount\n, allowed_amount\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved with exclusion logic applied.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_sum": {"name": "exclusion_sum", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_rate": {"name": "performance_rate", "description": "Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.4796398, "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": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_counts.sql", "compiled": true, "compiled_code": "\n\nwith summary_long as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Long view of the results for the reporting version of all measures. Each row represents the results a measure per patient. A null for the denominator indicates that the patient was not eligible for that measure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.494925, "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": [{"name": "quality_measures__int_nqf2372_long", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_wide": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Wide view of the results for the reporting version of all measures. This model pivots measures on the patient level (i.e. one row per patient with flags for each measure. The false flags can be treated as care gaps as exclusions have been included in the pivot logic.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "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, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.494925, "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": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_wide.sql", "compiled": true, "compiled_code": "\n\n/*\n Each measure is pivoted into a boolean column by evaluating the\n denominator, numerator, and exclusion flags.\n*/\nwith measures_long as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.494925, "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": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20'\n )\n\n as date) as performance_period_begin\n , cast('2023-09-20'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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.494925, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with a mastectomy for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.510778, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5257847, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_dementia", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_hospice", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_institutional", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_mastectomy", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_palliative", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 2372, Breast Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5257847, "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": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"database": "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": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5257847, "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": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.541411, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging encounters from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.541411, "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": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.541411, "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": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__observation": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.5570354, "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": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__patient": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medical claims from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "medical_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"database": "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044213.557728, "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": [{"name": "pharmacy_claim", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "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": "0daac473352f61c08f988c8ab8a846407106b72a95c0570c736dc3a74deae274"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounters from the stg_encounter model, and for each encounter_id we add fields relevant for the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_disposition_code_flag": {"name": "missing_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_discharge_disposition_code_flag": {"name": "invalid_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnoses_flag": {"name": "multiple_primary_diagnoses_flag", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code_flag": {"name": "invalid_primary_diagnosis_code_flag", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_ms_drg_flag": {"name": "missing_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with a missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_ms_drg_flag": {"name": "invalid_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with an invalid missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.5894413, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_admission", "package": null, "version": null}, {"name": "readmissions__planned_encounter", "package": null, "version": null}, {"name": "readmissions__encounter_specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter_data_quality", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_data_quality"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__encounter_augmented.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter model\n-- and we augment them with extra fields\n-- that are relevant for readmission measures\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "d23797e63755cd3577c7f8a996f0ce273404bb6946a78b42c1bd26c54ddf29d0"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all rows from the encounter_augmented model where disqualified_encounter_flag = 0 (all rows for encounters that are not disqualified for data quality issues). For each of these encounters we add fields to indicate whether it had a readmission and, when a readmission was present, to show relevant fields for the readmission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "unplanned_readmit_30_flag": {"name": "unplanned_readmit_30_flag", "description": "A flag to indicate whether the encounter had an unplanned 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_disposition_code": {"name": "readmission_discharge_disposition_code", "description": "The valid 2-digit discharge status for the readmission inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_length_of_stay": {"name": "readmission_length_of_stay", "description": "Integer representing the length of stay of the readmission inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmission_index_admission_flag": {"name": "readmission_index_admission_flag", "description": "Flag to indicate if the readmission encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_died_flag": {"name": "readmission_died_flag", "description": "Flag to indicate of the patient died in the readmission encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.60513, "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": [{"name": "readmissions__encounter_augmented", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter_augmented"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__readmission_summary.sql", "compiled": true, "compiled_code": "\n\n-- Here calculate days to readmission for encounters\n-- that had a readmission and create readmission flags\n\n\n-- We create the encounter_sequence integer count\n-- which keeps track of what number of encounter each\n-- encounter is for a given patient\nwith encounter_sequence as (\nselect\n *,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom\n encounter_sequence aa\n left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\nselect *\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__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": "4b460d9cc3286c8f921fb550420c721c8f9f44f2b57bce7e6747953c70973f51"}, "config": {"enabled": true, "alias": "_int_stg_diagnosis", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique 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, "constraints": [], "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.6568325, "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": [{"name": "readmissions__stg_core__condition", "package": null, "version": null}, {"name": "readmissions__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__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": "5b485cdf20bb22edb4b4a1bf63eb844aca501ffc84845a3b700e9c879a9c9f57"}, "config": {"enabled": true, "alias": "_int_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "diagnosis_code": {"name": "diagnosis_code", "description": "An ICD-10-CM diagnosis code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_rank": {"name": "diagnosis_rank", "description": "A positive integer giving the diagnosis ranking for the encounter", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.60513, "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": [{"name": "readmissions__diagnosis", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "readmissions__icd_10_cm_to_ccs", "package": null, "version": null}, {"name": "readmissions__primary_diagnosis_count", "package": null, "version": null}], "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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique acute inpatient encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_status_code": {"name": "discharge_status_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6568325, "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": [{"name": "readmissions__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount as total_paid_amount,\n '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "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": "28ffdacb8ba06a3c8437791944199132035c78a224739e274ea18426ec95690b"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model has the same number of rows as the stg_encounter model. Here we have one row for every unique encounter in the stg_encounter model, and for each encounter we have a flag (disqualified_encounter_flag) to indicte if the encounter is disqualified from being useful for readmission measures. We also have other flags to indicate which specific data quality issues this encounter has that may disqualify it from being used in readmission measures.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "The CCS diagnosis category associated with the primary diagnosis of this encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_status_code_flag": {"name": "missing_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_discharge_status_code_flag": {"name": "invalid_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnosis": {"name": "multiple_primary_diagnosis", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code": {"name": "invalid_primary_diagnosis_code", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "readmissions__primary_diagnosis_count", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter", "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "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": "1c7b360019c87f39f47fca7555497ea60e76437e12651b9ad530231d23dd69c4"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all pairs of encounters that have some date overlap.", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "compiled": true, "compiled_code": "\n\n-- Here we give a list of all pairs of encounters\n-- that have some date overlap.\n\n\nwith encounters_with_row_num as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over (\n partition by patient_id order by encounter_id\n\t) as row_num\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "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": "15b18818225404f45fd340e90d5a1f5091b3b4749449afd9ca12dc98c7bc5318"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists the specialty cohort associated with each inpatient encounter. All encounters in the stg_encounter model are present here, and each gets a specialty cohort assigned from the following list of 5 options: Surgery/Gynecology, Medicine, Cardiorespiratory, Cardiovascular, Neurology. Encounters that don't have a specialty cohort get 'Medicine' assigned by default.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__surgery_gynecology_cohort", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "971c59e8ac1cd4109b624c18661cd21bdcece87d519e295ad527877cf9f272e6"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that are excluded from being index admissions because they belong to one of the exclusion categories.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.620135, "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": [{"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__exclusion_ccs_diagnosis_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_admission": {"database": "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": "6738ce6caa0e59ff726e0de97727f6690a8a50588bbcc80d7273f0529c8f7b28"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all index admissions for the hospital wide readmissions measure. These represent encounter_ids that meet the requirements to be an index admission for the HWR measure.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_time_requirement", "package": null, "version": null}, {"name": "readmissions__index_discharge_requirement", "package": null, "version": null}, {"name": "readmissions__exclusion", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__exclusion"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_admission.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all index admissions for the hospital wide readmissions\n-- measure.\n-- These represent encounter_ids that meet the requirements to be an\n-- index admission for the HWR measure.\n-- These are the requirements for a hospitalization to be an index admission\n-- for the HWR measure:\n--\n-- Time Requirement: The discharge data must be at least 30 days\n-- earlier than the last dischareg date available\n-- in the dataset.\n-- \n-- Discharge Requirements: The patient must not be discharged to another\n-- acute care hospital; the patient must not have\n-- left against medical advice; and the patient\n-- must be alive at discharge.\n--\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\n-- (exclusions) diagnosis category we know the encounter was\n-- for medical treatment of cancer, rehabilitation,\n-- or psychiatric reasons.\n\n\n\nselect distinct a.encounter_id, '2023-09-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the discharge disposition requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the discharge_disposition_code requirements to be an\n-- index admission:\n-- *** Must NOT be discharged to another acute care hospital\n-- *** Must NOT have left against medical advice\n-- *** Patient must be alive at discharge\n\n\n\nwith all_invalid_discharges as (\nselect encounter_id\nfrom 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-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "40c6de083114da8d6532fdb522bc8a8410818581c59dd50154d288c07dc56674"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the time requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the time requirement to be an index admission:\n-- The discharge date must be at least 30 days\n-- earlier than the last discharge date available\n-- in the dataset.\n\n\n\nselect encounter_id, '2023-09-20 12:50:16.377540+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": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "96a7a74e0a4225446cb107fcc6fd6d6295a0cc43d4df83e2b123e072797eba46"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model gives a list of all encounter_ids that were planned encounters.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6357615, "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": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_diagnosis_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__diagnosis_ccs", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_icd_10_cm", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__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-20 12:50:16.377540+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__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": "3bc2a8857da46830d11058b12ce0f2f13553f2e233e5d193e3a17c0866c28094"}, "config": {"enabled": true, "alias": "_int_primary_diagnosis_count", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044213.6357615, "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": [{"name": "readmissions__diagnosis", "package": null, "version": null}, {"name": "readmissions__diagnosis", "package": null, "version": null}], "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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom all_primary_diagnosis_count", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "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": "f6e02b38211237f005f1473d0354f0a7bd5682f51b8d75cacdba48a87f3ab80a"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all procedures from the stg_procedure model and adds a valid_icd_10_pcs_flag to indicate if the ICD-10-PCS code for this procedure is valid. We also add the CCS procedure category associated with the procedure", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "valid_icd_10_pcs_flag": {"name": "valid_icd_10_pcs_flag", "description": "A flag indicating if the ICD-10-PCS procedure code given is valid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_procedure_category": {"name": "ccs_procedure_category", "description": "The CCS code associated with the given ICD-10-PCS procedure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6532915, "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": [{"name": "readmissions__stg_core__procedure", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__icd_10_pcs_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": "909dc931da16c541ec984f85ed9e0a00c405c6c8dbed2c5ffb1fd7398b5228af"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters and whether they had a 'crude' readmission, meaning that the encounter had a hospitalization after discharge, without regard to all CMS readmission logic.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044213.6568325, "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": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "compiled": true, "compiled_code": "\n\n-- Here we calculate readmissions using all encounters\n-- that have valid admit and discharge dates and no overlap.\n-- This is meant to give a crude sense of the readmission\n-- rate without taking into account all the CMS HWR logic.\n\n\nwith encounter_info as (\nselect\n enc.encounter_id,\n enc.patient_id,\n enc.admit_date,\n enc.discharge_date\nfrom 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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "tuva", "schema": "test", "name": "readmissions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__condition.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__condition", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__condition"], "alias": "readmissions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "4ea14670bd02d6f754b0f9a16b1b45901fc4867994744bc8bac7c0158a709e6f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "tuva", "schema": "test", "name": "readmissions__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__encounter.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__encounter", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__encounter"], "alias": "readmissions__stg_core__encounter", "checksum": {"name": "sha256", "checksum": "5249f0c60b5b8811dd92025a0ec873c8bd58e0424e987c86cb9f383a2777a052"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount as total_paid_amount,\n '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__medical_claim": {"database": "tuva", "schema": "test", "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": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "tuva", "schema": "test", "name": "readmissions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__procedure.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__procedure", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__procedure"], "alias": "readmissions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "9e824936a255b3a5db4efb05406eefe00731e8e589c979fb05d558712df43e62"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044213.6673403, "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": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9510415, "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": [{"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9666665, "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": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9666665, "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": [{"name": "quality_measures__summary_counts", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044211.9666665, "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": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "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": [], "contract": {"enforced": false, "checksum": null}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3342583, "relation_name": "tuva.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3342583, "relation_name": "tuva.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "9ae17ac5f4c0402ea13dbfbcfeaf80f4682ae1b1cea409938a13027190123e25"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4788878, "relation_name": "tuva.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "a30409aaf8f09a28b1f74504f93599124fa9668d4c237d7ac6f750b29077f59c"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3342583, "relation_name": "tuva.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "c729ee5edea312f536019ccadfb3faab36db065b2f28f3430c153aacf4c6debf"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.349885, "relation_name": "tuva.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__claim_type": {"database": "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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.349885, "relation_name": "tuva.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.349885, "relation_name": "tuva.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3657916, "relation_name": "tuva.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "9aae0124d4473a2c2270047023e09839d56ecaeaeb93ad9d5c0fa4b96487db20"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3657916, "relation_name": "tuva.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3657916, "relation_name": "tuva.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3818326, "relation_name": "tuva.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.3976545, "relation_name": "tuva.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_pcs": {"database": "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": "1d18cafa0d405e60cd1be1e039fbfb2dfa9591a1cef6a441b60c26a61de41ad3"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.3976545, "relation_name": "tuva.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_cm": {"database": "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.3976545, "relation_name": "tuva.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "b44148131246b1ed7c1a1306dc9954f5452bc0bd1af9bcbba29ed5cea7dd6811"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4302733, "relation_name": "tuva.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "59c383f6987150669a1ced8a8362e2f742412ca86bb8631e2165e2de6501dec8"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4302733, "relation_name": "tuva.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#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": 1695044212.4462423, "relation_name": "tuva.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__payer_type": {"database": "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": "7e412080b0b85b4b94dd91b2deeb955c73fd1112826537c29fe7194ee0da35b9"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payer_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4462423, "relation_name": "tuva.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "bfdbdb39992351ff6f3c4ef9b69d0bcc8c5d1e4193b8a8d2efe275cf170c13a4"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4462423, "relation_name": "tuva.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "a53d973affea45af6de5f792bcf6569456f5a886340a7c2670c20b840b0f1d59"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4612515, "relation_name": "tuva.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.4612515, "relation_name": "tuva.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__race": {"database": "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": "04c8b2edc87b3c4a95053e5df9c7d7e82916c994a0659f327a835fe3526dcbc6"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"race_code": "varchar", "race_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4768798, "relation_name": "tuva.terminology.race", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "cbfe51143ddca77ca6964687e53c15b1df104d1244455668271f3eb8d04fee78"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4788878, "relation_name": "tuva.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\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": "04926dcab30c1a58db064b4edfe3e367128b85e544dd922c4331858a8594203c"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.4135716, "relation_name": "tuva.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.4928944, "relation_name": "tuva.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"database": "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": "fd84423264c0174b1fc1e2ba23f1ac7957ef4fa7aaefcb2c45932f587b59fedf"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"database": "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": {}, "group": null, "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"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "765b1e8cf4a724b2269f44bc43e1d1ad8bbcdaf693afc6e2750e3f3f62b29ab3"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up into", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The icd10 code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_description": {"name": "icd_10_cm_description", "description": "The description for the icd10 code", "meta": {}, "data_type": null, "constraints": [], "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, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "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": 1695044212.5095184, "relation_name": "tuva.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5245366, "relation_name": "tuva.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease hierarchies by model version. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.5409012, "relation_name": "tuva.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5409012, "relation_name": "tuva.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5409012, "relation_name": "tuva.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.5559072, "relation_name": "tuva.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.5559072, "relation_name": "tuva.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.5559072, "relation_name": "tuva.data_profiling._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__categories": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__categories.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__categories.csv", "unique_id": "seed.the_tuva_project.ed_classification__categories", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__categories"], "alias": "_value_set_categories", "checksum": {"name": "sha256", "checksum": "2063ce406aa7ed5edc420f94712a2c07cd5d591da671b5fe5270fc6b74ab8a72"}, "config": {"enabled": true, "alias": "_value_set_categories", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A mapping of ED Classifications to human readable names", "columns": {"classification": {"name": "classification", "description": "code for classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "human readable name for classification", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "Sortable column that organizes the ED classes", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_categories", "tags": "ed_classification", "enabled": true}, "created_at": 1695044212.5559072, "relation_name": "tuva.ed_classification._value_set_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "ed_classification", "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "enabled": true}, "created_at": 1695044212.5721533, "relation_name": "tuva.ed_classification._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__johnston_icd10", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd10"], "alias": "_value_set_johnston_icd10", "checksum": {"name": "path", "checksum": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd10.csv"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd10", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd10": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd10": {"name": "icd10", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_johnston_icd10", "tags": "ed_classification", "enabled": true, "column_types": {"icd10": "varchar"}}, "created_at": 1695044212.5791607, "relation_name": "tuva.ed_classification._value_set_johnston_icd10", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"database": "tuva", "schema": "ed_classification", "name": "ed_classification__johnston_icd9", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd9"], "alias": "_value_set_johnston_icd9", "checksum": {"name": "sha256", "checksum": "2c03fd558f0551a067248da92996e296fc848ff18ebe7e3b4377c92055689c7a"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd9", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd9": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd9": {"name": "icd9", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_johnston_icd9", "tags": "ed_classification", "enabled": true, "column_types": {"icd9": "varchar"}}, "created_at": 1695044212.5791607, "relation_name": "tuva.ed_classification._value_set_johnston_icd9", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.587717, "relation_name": "tuva.quality_measures._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "group": null, "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": 1695044212.587717, "relation_name": "tuva.quality_measures._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695044212.6032238, "relation_name": "tuva.quality_measures._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "162e0b9ea270ac718cf9b09e73be76c24f989de8bd1914a1a057f7acb3f61ad7"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6032238, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6032238, "relation_name": "tuva.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "3c043831ad01c7c64351d16f95ac22a634bbb966fd1e76d63fff7e02b62c217a"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6032238, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "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": "fd4817e3125593d3fba796d06308328d873b5f4c858e5e0eb334f7ad67b78d59"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6188514, "relation_name": "tuva.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "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": "4acbeae1bdb123aa1f45a9de2fd1937fdf402207b0469265cf1b57a9d262c149"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6188514, "relation_name": "tuva.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.6344733, "relation_name": "tuva.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"database": "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": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "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": {}, "group": null, "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": 1695044212.6344733, "relation_name": "tuva.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"database": "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": "eadf8c6d9111791ab7ab407746f15917d20837f5f3208299e52c12d9e5ae73b0"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6344733, "relation_name": "tuva.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "d043a3ac9422b5ff045a14b77bb0ecbef7e3515a85832e547b665206ce013170"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6500967, "relation_name": "tuva.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "776448ba060d5eaf1b1fa125c228d201c3e538a155b48a33694895c30b922138"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6514847, "relation_name": "tuva.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "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": "2df8c3d1db81bb0c7fdbb3365290ea6ee22786c311298c05703ef49dcc1e37b4"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6514847, "relation_name": "tuva.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "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": {}, "group": null, "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}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["service_category"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "group": null, "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": 1695044212.6514847, "relation_name": "tuva.service_category._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd9_icd9"], "alias": "unique_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd9 as unique_field,\n count(*) as n_records\n\nfrom tuva.ed_classification._value_set_johnston_icd9\nwhere icd9 is not null\ngroup by icd9\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd9_icd9"], "alias": "not_null_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd9\nfrom tuva.ed_classification._value_set_johnston_icd9\nwhere icd9 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd10_icd10"], "alias": "unique_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd10 as unique_field,\n count(*) as n_records\n\nfrom tuva.ed_classification._value_set_johnston_icd10\nwhere icd10 is not null\ngroup by icd10\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd10_icd10"], "alias": "not_null_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044212.587717, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd10\nfrom tuva.ed_classification._value_set_johnston_icd10\nwhere icd10 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044212.6985013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\not_null_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044212.6985013, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\unique_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n claim_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1695044212.7637312, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1695044212.7637312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || claim_id || start_date || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || claim_id || start_date || condition) as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1695044212.7792563, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom tuva.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Opioid Use Disorder (OUD)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1695044212.7957628, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_long')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1695044212.8273559, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || condition) as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1695044212.8273559, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1695044212.8273559, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.unique_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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__patient_risk_scores_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores", "attached_node": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_demographic_factors", "attached_node": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_code", "model": "{{ get_where_subquery(ref('cms_hcc__int_eligible_conditions')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_code\nfrom tuva.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_code", "file_key_name": "models.cms_hcc__int_eligible_conditions", "attached_node": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom tuva.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.142333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom 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": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_claim')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "unique_ed_classification__int_condition_with_claim_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__int_condition_with_claim_claim_id.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba", "fqn": ["the_tuva_project", "ed_classification", "unique_ed_classification__int_condition_with_claim_claim_id"], "alias": "unique_ed_classification__int_condition_with_claim_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.3998904, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\unique_ed_classification__int_condition_with_claim_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.ed_classification._int_condition_with_claim\nwhere claim_id is not null\ngroup by claim_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ed_classification__int_condition_with_claim", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_claim')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__int_condition_with_claim_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__int_condition_with_claim_claim_id.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1", "fqn": ["the_tuva_project", "ed_classification", "not_null_ed_classification__int_condition_with_claim_claim_id"], "alias": "not_null_ed_classification__int_condition_with_claim_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.3998904, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\not_null_ed_classification__int_condition_with_claim_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom tuva.ed_classification._int_condition_with_claim\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ed_classification__int_condition_with_claim", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ccs_description_with_covid", "model": "{{ get_where_subquery(ref('ed_classification__unclassified_conditions')) }}"}, "namespace": null}, "database": "tuva", "schema": "dbt_test__audit", "name": "not_null_ed_classification__unclassified_conditions_ccs_description_with_covid", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5", "fqn": ["the_tuva_project", "ed_classification", "not_null_ed_classification__unclassified_conditions_ccs_description_with_covid"], "alias": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169", "severity": "WARN"}, "created_at": 1695044213.416173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169\") }}", "language": "sql", "refs": [{"name": "ed_classification__unclassified_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__unclassified_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\not_null_ed_classification__un_a3eca8dc39caedf634bbda08fce4e169.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect ccs_description_with_covid\nfrom tuva.ed_classification._int_unclassified_conditions\nwhere ccs_description_with_covid is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "ccs_description_with_covid", "file_key_name": "models.ed_classification__unclassified_conditions", "attached_node": "model.the_tuva_project.ed_classification__unclassified_conditions"}, "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50": {"test_metadata": {"name": "accepted_range", "kwargs": {"max_value": 20, "column_name": "condition_row_unclassified_percent", "model": "{{ get_where_subquery(ref('ed_classification__unclassified_rows')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20"], "alias": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b"}, "created_at": 1695044213.416173, "relation_name": null, "raw_code": "{{ dbt_utils.test_accepted_range(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b\") }}", "language": "sql", "refs": [{"name": "ed_classification__unclassified_rows", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_accepted_range", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__unclassified_rows"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\ed_classification_models.yml\\dbt_utils_accepted_range_ed_cl_cee862cbae4c3ab44428313698c8fc8b.sql", "compiled": true, "compiled_code": "\n\nwith meet_condition as(\n select *\n from tuva.ed_classification._int_unclassified_rows\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 -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not condition_row_unclassified_percent <= 20\n)\n\nselect *\nfrom validation_errors\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_row_unclassified_percent", "file_key_name": "models.ed_classification__unclassified_rows", "attached_node": "model.the_tuva_project.ed_classification__unclassified_rows"}, "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": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1695044213.4796398, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\financial_pmpm_models.yml\\unique_financial_pmpm__pmpm_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": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep", "attached_node": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__condition')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__condition_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__condition", "attached_node": "model.the_tuva_project.quality_measures__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__encounter')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__encounter_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.encounter\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__encounter", "attached_node": "model.the_tuva_project.quality_measures__stg_core__encounter"}, "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__medication')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__medication_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__medication", "attached_node": "model.the_tuva_project.quality_measures__stg_core__medication"}, "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__observation')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__observation_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__observation", "attached_node": "model.the_tuva_project.quality_measures__stg_core__observation"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.572735, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.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": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_12782dbc4c931575c089a8978147a897\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\accepted_values_quality_measur_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-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_birth_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "birth_date", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__procedure')) }}"}, "namespace": null}, "database": "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": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1695044213.5797422, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__procedure_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-09-20 12:50:16.377540+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-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure", "attached_node": "model.the_tuva_project.quality_measures__stg_core__procedure"}, "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": "ea9acf2bf751aa5406ed423bb25ebf15fbda10b2afde9fd998c4b65a22170819"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper"], "meta": {}, "group": null, "materialized": "table", "incremental_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}, "contract": {"enforced": false}, "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, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The second, more specific service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": 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": 1695213904.4062514, "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\nwith service_category_1_mapping as(\r\n select distinct \r\n a.claim_id\r\n , a.claim_line_number\r\n , a.claim_type\r\n , case\r\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\r\n when service_category_2 = 'Ambulance' then 'Ancillary'\r\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\r\n when service_category_2 = 'Dialysis' then 'Outpatient'\r\n when service_category_2 = 'Durable Medical Equipment' then 'Ancillary'\r\n when service_category_2 = 'Emergency Department' then 'Outpatient'\r\n when service_category_2 = 'Home Health' then 'Outpatient'\r\n when service_category_2 = 'Hospice' then 'Outpatient'\r\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\r\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\r\n when service_category_2 = 'Lab' then 'Ancillary'\r\n when service_category_2 = 'Office Visit' then 'Office Visit'\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient'\r\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\r\n when service_category_2 = 'Urgent Care' then 'Outpatient'\r\n when service_category_2 is null then 'Other'\r\n end service_category_1\r\n , case\r\n when service_category_2 is null then 'Other'\r\n else service_category_2\r\n end service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('service_category__stg_medical_claim') }} a\r\n left join {{ ref('service_category__combined_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n where a.claim_type = 'professional'\r\n\r\n union all\r\n\r\n select distinct \r\n a.claim_id\r\n , a.claim_line_number\r\n , a.claim_type\r\n , case\r\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\r\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\r\n when service_category_2 = 'Dialysis' then 'Outpatient'\r\n when service_category_2 = 'Emergency Department' then 'Outpatient'\r\n when service_category_2 = 'Home Health' then 'Outpatient'\r\n when service_category_2 = 'Hospice' then 'Outpatient'\r\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\r\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\r\n when service_category_2 = 'Lab' then 'Ancillary'\r\n when service_category_2 = 'Office Visit' then 'Office Visit'\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\r\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\r\n when service_category_2 = 'Urgent Care' then 'Outpatient'\r\n when service_category_2 is null then 'Other'\r\n end service_category_1\r\n , case\r\n when service_category_2 is null then 'Other'\r\n else service_category_2\r\n end service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('service_category__stg_medical_claim') }} a\r\n left join {{ ref('service_category__combined_institutional') }} b\r\n on a.claim_id = b.claim_id\r\n where a.claim_type = 'institutional'\r\n)\r\n, service_category_2_deduplication as(\r\n select \r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\n , row_number() over (partition by claim_id, claim_line_number order by \r\n case\r\n when service_category_2 = 'Acute Inpatient' then 3\r\n when service_category_2 = 'Ambulance' then 7\r\n when service_category_2 = 'Ambulatory Surgery' then 8\r\n when service_category_2 = 'Dialysis' then 17\r\n when service_category_2 = 'Durable Medical Equipment' then 1\r\n when service_category_2 = 'Emergency Department' then 5\r\n when service_category_2 = 'Home Health' then 9\r\n when service_category_2 = 'Hospice' then 10\r\n when service_category_2 = 'Inpatient Psychiatric' then 11\r\n when service_category_2 = 'Inpatient Rehabilitation' then 12\r\n when service_category_2 = 'Lab' then 13\r\n when service_category_2 = 'Office Visit' then 4\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\r\n when service_category_2 = 'Outpatient Psychiatric' then 15\r\n when service_category_2 = 'Outpatient Rehabilitation' then 16\r\n when service_category_2 = 'Skilled Nursing' then 6\r\n when service_category_2 = 'Urgent Care' then 2\r\n when service_category_2 is null then 18\r\n else 99 end) as duplicate_row_number\r\n from claims_preprocessing.service_category_grouper\r\n)\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\nfrom service_category_2_deduplication\r\nwhere duplicate_row_number = 1", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_professional", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n),service_category_1_mapping as(\n select distinct \n a.claim_id\n , a.claim_line_number\n , a.claim_type\n , case\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\n when service_category_2 = 'Ambulance' then 'Ancillary'\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\n when service_category_2 = 'Dialysis' then 'Outpatient'\n when service_category_2 = 'Durable Medical Equipment' then 'Ancillary'\n when service_category_2 = 'Emergency Department' then 'Outpatient'\n when service_category_2 = 'Home Health' then 'Outpatient'\n when service_category_2 = 'Hospice' then 'Outpatient'\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\n when service_category_2 = 'Lab' then 'Ancillary'\n when service_category_2 = 'Office Visit' then 'Office Visit'\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\n when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient'\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\n when service_category_2 = 'Urgent Care' then 'Outpatient'\n when service_category_2 is null then 'Other'\n end service_category_1\n , case\n when service_category_2 is null then 'Other'\n else service_category_2\n end service_category_2\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left 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\n where a.claim_type = 'professional'\n\n union all\n\n select distinct \n a.claim_id\n , a.claim_line_number\n , a.claim_type\n , case\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\n when service_category_2 = 'Dialysis' then 'Outpatient'\n when service_category_2 = 'Emergency Department' then 'Outpatient'\n when service_category_2 = 'Home Health' then 'Outpatient'\n when service_category_2 = 'Hospice' then 'Outpatient'\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\n when service_category_2 = 'Lab' then 'Ancillary'\n when service_category_2 = 'Office Visit' then 'Office Visit'\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\n when service_category_2 = 'Urgent Care' then 'Outpatient'\n when service_category_2 is null then 'Other'\n end service_category_1\n , case\n when service_category_2 is null then 'Other'\n else service_category_2\n end service_category_2\n , '2023-09-20 12:50:16.377540+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join tuva.claims_preprocessing._int_combined_institutional b\n on a.claim_id = b.claim_id\n where a.claim_type = 'institutional'\n)\n, service_category_2_deduplication as(\n select \n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\n , row_number() over (partition by claim_id, claim_line_number order by \n case\n when service_category_2 = 'Acute Inpatient' then 3\n when service_category_2 = 'Ambulance' then 7\n when service_category_2 = 'Ambulatory Surgery' then 8\n when service_category_2 = 'Dialysis' then 17\n when service_category_2 = 'Durable Medical Equipment' then 1\n when service_category_2 = 'Emergency Department' then 5\n when service_category_2 = 'Home Health' then 9\n when service_category_2 = 'Hospice' then 10\n when service_category_2 = 'Inpatient Psychiatric' then 11\n when service_category_2 = 'Inpatient Rehabilitation' then 12\n when service_category_2 = 'Lab' then 13\n when service_category_2 = 'Office Visit' then 4\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\n when service_category_2 = 'Outpatient Psychiatric' then 15\n when service_category_2 = 'Outpatient Rehabilitation' then 16\n when service_category_2 = 'Skilled Nursing' then 6\n when service_category_2 = 'Urgent Care' then 2\n when service_category_2 is null then 18\n else 99 end) as duplicate_row_number\n from claims_preprocessing.service_category_grouper\n)\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\nfrom service_category_2_deduplication\nwhere duplicate_row_number = 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-09-20 12:50:16.377540+00:00' as tuva_last_run\nfrom tuva.claims_data_model.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}}, "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": 1695044209.5939333, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "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": 1695044209.6095548, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_table_as": {"name": "snowflake__create_table_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_table_as", "macro_sql": "{% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {% set compiled_code = get_select_subquery(compiled_code) %}\n {% endif %}\n {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from (\n {{ compiled_code }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ compiled_code }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n\n {%- elif language == 'python' -%}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation, temporary=temporary) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"snowflake__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery", "macro.dbt_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag": {"name": "snowflake__create_view_as_with_temp_flag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro_sql": "{% macro snowflake__create_view_as_with_temp_flag(relation, sql, is_temporary=False) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} {% if is_temporary -%}\n temporary\n {%- endif %} view {{ relation }}\n {% if config.persist_column_docs() -%}\n {% set model_columns = model.columns %}\n {% set query_columns = get_columns_in_query(sql) %}\n {{ get_persist_docs_column_list(model_columns, query_columns) }}\n\n {%- endif %}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt_snowflake.get_persist_docs_column_list", "macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_relations_without_caching": {"name": "snowflake__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_relations_without_caching", "macro_sql": "{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many objects in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6257303, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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.use_database(target_relation.database)\n session.use_schema(target_relation.schema)\n # session.write_pandas does not have overwrite function\n df = session.createDataFrame(df)\n {% set target_relation_name = resolve_model_name(target_relation) %}\n df.write.mode(\"overwrite\").save_as_table('{{ target_relation_name }}', create_temp_table={{temporary}})\n\ndef main(session):\n dbt = dbtObj(session.table)\n df = model(dbt, session)\n materialize(session, df, dbt.this)\n return \"OK\"\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_view_snowflake": {"name": "materialization_view_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\view.sql", "original_file_path": "macros\\materializations\\view.sql", "unique_id": "macro.dbt_snowflake.materialization_view_snowflake", "macro_sql": "{% materialization view, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.create_or_replace_view", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6412375, "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": 1695044209.6568627, "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": 1695044209.6576471, "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": 1695044209.6576471, "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": 1695044209.6576471, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "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": 1695044209.661002, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql) %}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {{ col_err.append(col['name']) }}\n {%- endif -%}\n cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "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": 1695044209.661002, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.661002, "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": 1695044209.6765091, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6772833, "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": 1695044209.6922905, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.6929927, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.7079992, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.723626, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(model['columns'])) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "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": 1695044209.739249, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select\n {% for column in model['columns'] %}\n {{ column }}{{ \", \" if not loop.last }}\n {% endfor %}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "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": 1695044209.7548728, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "original_file_path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7548728, "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": 1695044209.7704952, "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": 1695044209.7704952, "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": 1695044209.7704952, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7765164, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.7871315, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.8026512, "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": 1695044209.818285, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8189843, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8339891, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8503501, "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": 1695044209.8653698, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8665478, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8765557, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8810625, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.8966892, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.9130278, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.928045, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": 1695044209.9443254, "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": {}, "groups": {}, "selectors": {}, "disabled": {"test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58": [{"test_metadata": {"name": "equal_rowcount", "kwargs": {"compare_model": "ref('ed_condition_with_class')", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_claim')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_.a2e02b6f58", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_equal_rowcount_ed_classification__int_condition_with_claim_ref_ed_condition_with_class_"], "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": false, "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "sum(coalesce(diff_count, 0))", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"fail_calc": "sum(coalesce(diff_count, 0))", "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0"}, "created_at": 1695044213.3998904, "config_call_dict": {"fail_calc": "sum(coalesce(diff_count, 0))", "alias": "dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0"}, "relation_name": null, "raw_code": "{{ dbt_utils.test_equal_rowcount(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_equal_rowcount_ed_cl_1d61096a7457f03d063017351ae84ed0\") }}", "language": "sql", "refs": [{"name": "ed_condition_with_class", "package": null, "version": null}, {"name": "ed_classification__int_condition_with_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_equal_rowcount", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_claim"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.ed_classification__int_condition_with_claim", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_claim"}], "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17": [{"test_metadata": {"name": "fewer_rows_than", "kwargs": {"compare_model": "ref('ed_condition')", "model": "{{ get_where_subquery(ref('ed_classification__int_condition_with_class')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_.05125e5f17", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_fewer_rows_than_ed_classification__int_condition_with_class_ref_ed_condition_"], "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": false, "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "sum(coalesce(row_count_delta, 0))", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"fail_calc": "sum(coalesce(row_count_delta, 0))", "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2"}, "created_at": 1695044213.3998904, "config_call_dict": {"fail_calc": "sum(coalesce(row_count_delta, 0))", "alias": "dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2"}, "relation_name": null, "raw_code": "{{ dbt_utils.test_fewer_rows_than(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_fewer_rows_than_ed_c_ab634114cc07e3388e794ee6fba32dc2\") }}", "language": "sql", "refs": [{"name": "ed_condition", "package": null, "version": null}, {"name": "ed_classification__int_condition_with_class", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_fewer_rows_than", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_condition_with_class"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.ed_classification__int_condition_with_class", "attached_node": "model.the_tuva_project.ed_classification__int_condition_with_class"}], "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a": [{"test_metadata": {"name": "equal_rowcount", "kwargs": {"compare_model": "ref('ed_condition')", "model": "{{ get_where_subquery(ref('ed_classification__int_merge_condition')) }}"}, "namespace": "dbt_utils"}, "database": "tuva", "schema": "dbt_test__audit", "name": "dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7.sql", "original_file_path": "models\\ed_classification\\ed_classification_models.yml", "unique_id": "test.the_tuva_project.dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_.5ac1ce205a", "fqn": ["the_tuva_project", "ed_classification", "dbt_utils_equal_rowcount_ed_classification__int_merge_condition_ref_ed_condition_"], "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": false, "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "sum(coalesce(diff_count, 0))", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"fail_calc": "sum(coalesce(diff_count, 0))", "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7"}, "created_at": 1695044213.416173, "config_call_dict": {"fail_calc": "sum(coalesce(diff_count, 0))", "alias": "dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7"}, "relation_name": null, "raw_code": "{{ dbt_utils.test_equal_rowcount(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_equal_rowcount_ed_cl_1313276944e07cf00786db20ee6c41c7\") }}", "language": "sql", "refs": [{"name": "ed_condition", "package": null, "version": null}, {"name": "ed_classification__int_merge_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_equal_rowcount", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ed_classification__int_merge_condition"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.ed_classification__int_merge_condition", "attached_node": "model.the_tuva_project.ed_classification__int_merge_condition"}]}, "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__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.ed_classification__claim_categorization": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "model.the_tuva_project.ed_classification__unclassified_conditions": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__unclassified_rows": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "seed.the_tuva_project.ed_classification__categories"], "model.the_tuva_project.ed_classification__int_by_ccs_description": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_patient_race": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_provider_parent_organization": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_provider_practice_state": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_year": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_by_year_month": ["model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_condition_with_claim": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_medical_claim", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.ed_classification__int_condition_with_class": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__int_merge_condition": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim", "seed.the_tuva_project.ed_classification__johnston_icd10", "seed.the_tuva_project.ed_classification__johnston_icd9"], "model.the_tuva_project.ed_classification__int_patient_list": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories"], "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": ["model.the_tuva_project.ed_classification__stg_condition", "model.the_tuva_project.ed_classification__stg_encounter", "model.the_tuva_project.ed_classification__stg_medical_claim", "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"], "model.the_tuva_project.ed_classification__stg_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ed_classification__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_eligibility", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.financial_pmpm__pmpm": ["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.ed_classification__categories": [], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": [], "seed.the_tuva_project.ed_classification__johnston_icd9": [], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": [], "seed.the_tuva_project.quality_measures__value_sets": [], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": [], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": [], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": [], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": [], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": [], "seed.the_tuva_project.readmissions__specialty_cohort": [], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": [], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.unique_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_ed_classification__int_condition_with_claim_claim_id.83085e1bba": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1": ["model.the_tuva_project.ed_classification__int_condition_with_claim"], "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5": ["model.the_tuva_project.ed_classification__unclassified_conditions"], "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50": ["model.the_tuva_project.ed_classification__unclassified_rows"], "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"], "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"]}, "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__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.ed_classification__stg_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.ed_classification__stg_encounter", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.core__lab_result": [], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.ed_classification__stg_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.ed_classification__stg_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.ed_classification__claim_categorization": [], "model.the_tuva_project.ed_classification__unclassified_conditions": ["test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5"], "model.the_tuva_project.ed_classification__unclassified_rows": ["test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ed_classification__int_by_ccs_description", "model.the_tuva_project.ed_classification__int_by_ccs_description", "model.the_tuva_project.ed_classification__int_by_patient_race", "model.the_tuva_project.ed_classification__int_by_patient_race", "model.the_tuva_project.ed_classification__int_by_provider_parent_organization", "model.the_tuva_project.ed_classification__int_by_provider_parent_organization", "model.the_tuva_project.ed_classification__int_by_provider_practice_state", "model.the_tuva_project.ed_classification__int_by_provider_practice_state", "model.the_tuva_project.ed_classification__int_by_year", "model.the_tuva_project.ed_classification__int_by_year_month", "model.the_tuva_project.ed_classification__int_by_year_month"], "model.the_tuva_project.ed_classification__int_by_ccs_description": [], "model.the_tuva_project.ed_classification__int_by_patient_race": [], "model.the_tuva_project.ed_classification__int_by_provider_parent_organization": [], "model.the_tuva_project.ed_classification__int_by_provider_practice_state": [], "model.the_tuva_project.ed_classification__int_by_year": [], "model.the_tuva_project.ed_classification__int_by_year_month": [], "model.the_tuva_project.ed_classification__int_condition_with_claim": ["model.the_tuva_project.ed_classification__claim_categorization", "model.the_tuva_project.ed_classification__summary", "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1", "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba"], "model.the_tuva_project.ed_classification__int_condition_with_class": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "model.the_tuva_project.ed_classification__int_patient_list"], "model.the_tuva_project.ed_classification__int_merge_condition": ["model.the_tuva_project.ed_classification__int_condition_with_class", "model.the_tuva_project.ed_classification__unclassified_conditions", "model.the_tuva_project.ed_classification__unclassified_rows"], "model.the_tuva_project.ed_classification__int_patient_list": [], "model.the_tuva_project.ed_classification__int_primary_dx_per_claim": ["model.the_tuva_project.ed_classification__int_merge_condition"], "model.the_tuva_project.ed_classification__stg_condition": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "model.the_tuva_project.ed_classification__stg_medical_claim": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.ed_classification__int_condition_with_claim", "model.the_tuva_project.ed_classification__int_patient_list"], "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", "model.the_tuva_project.ed_classification__int_condition_with_claim"], "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.ed_classification__categories": ["model.the_tuva_project.ed_classification__int_patient_list", "model.the_tuva_project.ed_classification__summary"], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": ["model.the_tuva_project.ed_classification__int_primary_dx_per_claim"], "seed.the_tuva_project.ed_classification__johnston_icd10": ["model.the_tuva_project.ed_classification__int_merge_condition", "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"], "seed.the_tuva_project.ed_classification__johnston_icd9": ["model.the_tuva_project.ed_classification__int_merge_condition", "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"], "seed.the_tuva_project.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.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": [], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": [], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": [], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": [], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": [], "test.the_tuva_project.unique_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_ed_classification__int_condition_with_claim_claim_id.83085e1bba": [], "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1": [], "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5": [], "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50": [], "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": [], "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"]}, "group_map": {}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 42a13bc01..c917b64dc 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.5.1", "generated_at": "2023-09-18T13:43:02.874611Z", "invocation_id": "7e2f524c-12d6-406b-b606-20d056e199a6", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.601360Z", "completed_at": "2023-09-18T13:42:58.601360Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.617028Z", "completed_at": "2023-09-18T13:42:58.617028Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025712966918945312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.601360Z", "completed_at": "2023-09-18T13:42:58.601360Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.617028Z", "completed_at": "2023-09-18T13:42:58.617028Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.025712966918945312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.601360Z", "completed_at": "2023-09-18T13:42:58.601360Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.617028Z", "completed_at": "2023-09-18T13:42:58.617028Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01566767692565918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.601360Z", "completed_at": "2023-09-18T13:42:58.601360Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.617028Z", "completed_at": "2023-09-18T13:42:58.617028Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01566767692565918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.601360Z", "completed_at": "2023-09-18T13:42:58.617028Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.617028Z", "completed_at": "2023-09-18T13:42:58.617028Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01566767692565918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.617028Z", "completed_at": "2023-09-18T13:42:58.632658Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.632658Z", "completed_at": "2023-09-18T13:42:58.632658Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031216144561767578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.632658Z", "completed_at": "2023-09-18T13:42:58.632658Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.648244Z", "completed_at": "2023-09-18T13:42:58.648244Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03481721878051758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.632658Z", "completed_at": "2023-09-18T13:42:58.632658Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.648244Z", "completed_at": "2023-09-18T13:42:58.648244Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03481721878051758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.632658Z", "completed_at": "2023-09-18T13:42:58.632658Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.651845Z", "completed_at": "2023-09-18T13:42:58.651845Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03481721878051758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.632658Z", "completed_at": "2023-09-18T13:42:58.632658Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.651845Z", "completed_at": "2023-09-18T13:42:58.651845Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03481721878051758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.677737Z", "completed_at": "2023-09-18T13:42:58.679789Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.691008Z", "completed_at": "2023-09-18T13:42:58.691008Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03916287422180176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.eligibility_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.664965Z", "completed_at": "2023-09-18T13:42:58.679789Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.691008Z", "completed_at": "2023-09-18T13:42:58.691008Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03916287422180176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.679789Z", "completed_at": "2023-09-18T13:42:58.684332Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.691008Z", "completed_at": "2023-09-18T13:42:58.691008Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.026042699813842773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.medical_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.672589Z", "completed_at": "2023-09-18T13:42:58.685205Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.691008Z", "completed_at": "2023-09-18T13:42:58.691008Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03916287422180176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.685205Z", "completed_at": "2023-09-18T13:42:58.685205Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.691008Z", "completed_at": "2023-09-18T13:42:58.691008Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026042699813842773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.pharmacy_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.706893Z", "completed_at": "2023-09-18T13:42:58.708773Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.017765045166015625, "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-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.030277013778686523, "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-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.030277013778686523, "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-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.030277013778686523, "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-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.708773Z", "completed_at": "2023-09-18T13:42:58.708773Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030277013778686523, "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-18T13:42:58.721285Z", "completed_at": "2023-09-18T13:42:58.721285Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.740475Z", "completed_at": "2023-09-18T13:42:58.740475Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.019190073013305664, "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-18T13:42:58.721285Z", "completed_at": "2023-09-18T13:42:58.736914Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.740475Z", "completed_at": "2023-09-18T13:42:58.740475Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.019190073013305664, "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-18T13:42:58.736914Z", "completed_at": "2023-09-18T13:42:58.738696Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.740475Z", "completed_at": "2023-09-18T13:42:58.740475Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.019190073013305664, "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-18T13:42:58.738696Z", "completed_at": "2023-09-18T13:42:58.740475Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.740475Z", "completed_at": "2023-09-18T13:42:58.740475Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.019190073013305664, "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-18T13:42:58.740475Z", "completed_at": "2023-09-18T13:42:58.740475Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.740475Z", "completed_at": "2023-09-18T13:42:58.740475Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030704975128173828, "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-18T13:42:58.755995Z", "completed_at": "2023-09-18T13:42:58.755995Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.771647Z", "completed_at": "2023-09-18T13:42:58.771647Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.021623849868774414, "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-18T13:42:58.755995Z", "completed_at": "2023-09-18T13:42:58.755995Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.771647Z", "completed_at": "2023-09-18T13:42:58.771647Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.021623849868774414, "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-18T13:42:58.755995Z", "completed_at": "2023-09-18T13:42:58.755995Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.771647Z", "completed_at": "2023-09-18T13:42:58.771647Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.021623849868774414, "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-18T13:42:58.755995Z", "completed_at": "2023-09-18T13:42:58.755995Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.773614Z", "completed_at": "2023-09-18T13:42:58.773614Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017618417739868164, "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-18T13:42:58.755995Z", "completed_at": "2023-09-18T13:42:58.755995Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.773614Z", "completed_at": "2023-09-18T13:42:58.773614Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017618417739868164, "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-18T13:42:58.773614Z", "completed_at": "2023-09-18T13:42:58.773614Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.014085054397583008, "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-18T13:42:58.773614Z", "completed_at": "2023-09-18T13:42:58.787699Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014085054397583008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.014085054397583008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.014085054397583008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.787699Z", "completed_at": "2023-09-18T13:42:58.787699Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.014085054397583008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.806471Z", "completed_at": "2023-09-18T13:42:58.806471Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.818979Z", "completed_at": "2023-09-18T13:42:58.818979Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.020486116409301758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.806471Z", "completed_at": "2023-09-18T13:42:58.806471Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.818979Z", "completed_at": "2023-09-18T13:42:58.818979Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01735830307006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.806471Z", "completed_at": "2023-09-18T13:42:58.806471Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.823829Z", "completed_at": "2023-09-18T13:42:58.823829Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01735830307006836, "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-18T13:42:58.806471Z", "completed_at": "2023-09-18T13:42:58.806471Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.823829Z", "completed_at": "2023-09-18T13:42:58.823829Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01735830307006836, "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-18T13:42:58.806471Z", "completed_at": "2023-09-18T13:42:58.818979Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.823829Z", "completed_at": "2023-09-18T13:42:58.823829Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01735830307006836, "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-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.026726722717285156, "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-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.028272151947021484, "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-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.028272151947021484, "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-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028272151947021484, "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-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.834922Z", "completed_at": "2023-09-18T13:42:58.834922Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.028272151947021484, "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-18T13:42:58.852101Z", "completed_at": "2023-09-18T13:42:58.852101Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.866688Z", "completed_at": "2023-09-18T13:42:58.866688Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0215909481048584, "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-18T13:42:58.852101Z", "completed_at": "2023-09-18T13:42:58.852101Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.866688Z", "completed_at": "2023-09-18T13:42:58.866688Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0215909481048584, "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-18T13:42:58.852101Z", "completed_at": "2023-09-18T13:42:58.852101Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.866688Z", "completed_at": "2023-09-18T13:42:58.866688Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0215909481048584, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.866688Z", "completed_at": "2023-09-18T13:42:58.866688Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.873692Z", "completed_at": "2023-09-18T13:42:58.873692Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0215909481048584, "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-18T13:42:58.866688Z", "completed_at": "2023-09-18T13:42:58.866688Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.873692Z", "completed_at": "2023-09-18T13:42:58.873692Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0215909481048584, "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-18T13:42:58.883379Z", "completed_at": "2023-09-18T13:42:58.883379Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.899077Z", "completed_at": "2023-09-18T13:42:58.899077Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.025384902954101562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.883379Z", "completed_at": "2023-09-18T13:42:58.890475Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.899077Z", "completed_at": "2023-09-18T13:42:58.899077Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025384902954101562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.890989Z", "completed_at": "2023-09-18T13:42:58.890989Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.899077Z", "completed_at": "2023-09-18T13:42:58.899077Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016374826431274414, "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-18T13:42:58.890989Z", "completed_at": "2023-09-18T13:42:58.890989Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.899077Z", "completed_at": "2023-09-18T13:42:58.899077Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015697717666625977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.890989Z", "completed_at": "2023-09-18T13:42:58.890989Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.899077Z", "completed_at": "2023-09-18T13:42:58.899077Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015697717666625977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.906287Z", "completed_at": "2023-09-18T13:42:58.906287Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.923191Z", "completed_at": "2023-09-18T13:42:58.923191Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01690387725830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__calendar"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.906287Z", "completed_at": "2023-09-18T13:42:58.906287Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.923191Z", "completed_at": "2023-09-18T13:42:58.923191Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01690387725830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.906287Z", "completed_at": "2023-09-18T13:42:58.906287Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.923191Z", "completed_at": "2023-09-18T13:42:58.923191Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01690387725830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__code_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.906287Z", "completed_at": "2023-09-18T13:42:58.906287Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.923191Z", "completed_at": "2023-09-18T13:42:58.923191Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01690387725830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.906287Z", "completed_at": "2023-09-18T13:42:58.906287Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:58.923191Z", "completed_at": "2023-09-18T13:42:58.923191Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01690387725830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:58.939915Z", "completed_at": "2023-09-18T13:42:59.000631Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.006674Z", "completed_at": "2023-09-18T13:42:59.006674Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.08348321914672852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.000631Z", "completed_at": "2023-09-18T13:42:59.000631Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.006674Z", "completed_at": "2023-09-18T13:42:59.006674Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08348321914672852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.000631Z", "completed_at": "2023-09-18T13:42:59.000631Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.006674Z", "completed_at": "2023-09-18T13:42:59.006674Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.08348321914672852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.000631Z", "completed_at": "2023-09-18T13:42:59.006674Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.006674Z", "completed_at": "2023-09-18T13:42:59.006674Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.08348321914672852, "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-18T13:42:59.006674Z", "completed_at": "2023-09-18T13:42:59.006674Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.006674Z", "completed_at": "2023-09-18T13:42:59.006674Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0934901237487793, "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-18T13:42:59.016681Z", "completed_at": "2023-09-18T13:42:59.016681Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.032964Z", "completed_at": "2023-09-18T13:42:59.032964Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016283273696899414, "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-18T13:42:59.016681Z", "completed_at": "2023-09-18T13:42:59.016681Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.032964Z", "completed_at": "2023-09-18T13:42:59.032964Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016283273696899414, "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-18T13:42:59.016681Z", "completed_at": "2023-09-18T13:42:59.016681Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.032964Z", "completed_at": "2023-09-18T13:42:59.032964Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016283273696899414, "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-18T13:42:59.016681Z", "completed_at": "2023-09-18T13:42:59.016681Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.032964Z", "completed_at": "2023-09-18T13:42:59.032964Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016283273696899414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__mdc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.016681Z", "completed_at": "2023-09-18T13:42:59.032307Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.032964Z", "completed_at": "2023-09-18T13:42:59.032964Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02328634262084961, "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-18T13:42:59.039967Z", "completed_at": "2023-09-18T13:42:59.039967Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.056625Z", "completed_at": "2023-09-18T13:42:59.056625Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01665806770324707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.039967Z", "completed_at": "2023-09-18T13:42:59.039967Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.056625Z", "completed_at": "2023-09-18T13:42:59.056625Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01665806770324707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.039967Z", "completed_at": "2023-09-18T13:42:59.052072Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.056625Z", "completed_at": "2023-09-18T13:42:59.056625Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01665806770324707, "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-18T13:42:59.052072Z", "completed_at": "2023-09-18T13:42:59.052072Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.056625Z", "completed_at": "2023-09-18T13:42:59.056625Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01665806770324707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.052072Z", "completed_at": "2023-09-18T13:42:59.052072Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.056625Z", "completed_at": "2023-09-18T13:42:59.056625Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01665806770324707, "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-18T13:42:59.072162Z", "completed_at": "2023-09-18T13:42:59.074317Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.017692089080810547, "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-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031198501586914062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__provider"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03177499771118164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.033559322357177734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.074317Z", "completed_at": "2023-09-18T13:42:59.074317Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.033559322357177734, "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-18T13:42:59.090185Z", "completed_at": "2023-09-18T13:42:59.141059Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.152112Z", "completed_at": "2023-09-18T13:42:59.152112Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06192755699157715, "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-18T13:42:59.119860Z", "completed_at": "2023-09-18T13:42:59.141059Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.152112Z", "completed_at": "2023-09-18T13:42:59.152112Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06723690032958984, "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-18T13:42:59.119860Z", "completed_at": "2023-09-18T13:42:59.141059Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.152112Z", "completed_at": "2023-09-18T13:42:59.152112Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06723690032958984, "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-18T13:42:59.157422Z", "completed_at": "2023-09-18T13:42:59.183244Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.199725Z", "completed_at": "2023-09-18T13:42:59.199725Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07169699668884277, "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-18T13:42:59.168237Z", "completed_at": "2023-09-18T13:42:59.183821Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.223809Z", "completed_at": "2023-09-18T13:42:59.223809Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07169699668884277, "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-18T13:42:59.183821Z", "completed_at": "2023-09-18T13:42:59.222884Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.230315Z", "completed_at": "2023-09-18T13:42:59.230315Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06207847595214844, "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-18T13:42:59.189954Z", "completed_at": "2023-09-18T13:42:59.223809Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.230315Z", "completed_at": "2023-09-18T13:42:59.230315Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06207847595214844, "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-18T13:42:59.199725Z", "completed_at": "2023-09-18T13:42:59.223809Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.230315Z", "completed_at": "2023-09-18T13:42:59.230315Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.054557085037231445, "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-18T13:42:59.238378Z", "completed_at": "2023-09-18T13:42:59.260229Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.260229Z", "completed_at": "2023-09-18T13:42:59.260229Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.06145286560058594, "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-18T13:42:59.246557Z", "completed_at": "2023-09-18T13:42:59.260229Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.291768Z", "completed_at": "2023-09-18T13:42:59.291768Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06145286560058594, "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-18T13:42:59.260229Z", "completed_at": "2023-09-18T13:42:59.291768Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.291768Z", "completed_at": "2023-09-18T13:42:59.291768Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04723525047302246, "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-18T13:42:59.275854Z", "completed_at": "2023-09-18T13:42:59.291768Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.307465Z", "completed_at": "2023-09-18T13:42:59.307465Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04723525047302246, "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-18T13:42:59.307465Z", "completed_at": "2023-09-18T13:42:59.323072Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.339796Z", "completed_at": "2023-09-18T13:42:59.339796Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04802823066711426, "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-18T13:42:59.323072Z", "completed_at": "2023-09-18T13:42:59.339796Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.354817Z", "completed_at": "2023-09-18T13:42:59.354817Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.048567771911621094, "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-18T13:42:59.323072Z", "completed_at": "2023-09-18T13:42:59.339796Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.371064Z", "completed_at": "2023-09-18T13:42:59.371064Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.048567771911621094, "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-18T13:42:59.339796Z", "completed_at": "2023-09-18T13:42:59.371640Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.371640Z", "completed_at": "2023-09-18T13:42:59.371640Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04699873924255371, "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-18T13:42:59.354817Z", "completed_at": "2023-09-18T13:42:59.371640Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.371640Z", "completed_at": "2023-09-18T13:42:59.371640Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04699873924255371, "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-18T13:42:59.371640Z", "completed_at": "2023-09-18T13:42:59.371640Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.386795Z", "completed_at": "2023-09-18T13:42:59.386795Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016351699829101562, "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-18T13:42:59.386795Z", "completed_at": "2023-09-18T13:42:59.386795Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.402302Z", "completed_at": "2023-09-18T13:42:59.402302Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03066253662109375, "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-18T13:42:59.386795Z", "completed_at": "2023-09-18T13:42:59.402302Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.402302Z", "completed_at": "2023-09-18T13:42:59.402302Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04667091369628906, "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-18T13:42:59.402302Z", "completed_at": "2023-09-18T13:42:59.402302Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.418311Z", "completed_at": "2023-09-18T13:42:59.418311Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03151559829711914, "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-18T13:42:59.418311Z", "completed_at": "2023-09-18T13:42:59.434359Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.452665Z", "completed_at": "2023-09-18T13:42:59.452665Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04786515235900879, "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-18T13:42:59.434359Z", "completed_at": "2023-09-18T13:42:59.452665Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.466176Z", "completed_at": "2023-09-18T13:42:59.466176Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04786515235900879, "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-18T13:42:59.434359Z", "completed_at": "2023-09-18T13:42:59.452665Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.466176Z", "completed_at": "2023-09-18T13:42:59.466176Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.031816720962524414, "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-18T13:42:59.452665Z", "completed_at": "2023-09-18T13:42:59.466176Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.466176Z", "completed_at": "2023-09-18T13:42:59.466176Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031816720962524414, "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-18T13:42:59.452665Z", "completed_at": "2023-09-18T13:42:59.466176Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.466176Z", "completed_at": "2023-09-18T13:42:59.466176Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031816720962524414, "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-18T13:42:59.466176Z", "completed_at": "2023-09-18T13:42:59.481974Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.497708Z", "completed_at": "2023-09-18T13:42:59.497708Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.047389984130859375, "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-18T13:42:59.481974Z", "completed_at": "2023-09-18T13:42:59.497708Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.513566Z", "completed_at": "2023-09-18T13:42:59.513566Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03159141540527344, "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-18T13:42:59.497708Z", "completed_at": "2023-09-18T13:42:59.513566Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.513566Z", "completed_at": "2023-09-18T13:42:59.513566Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03159141540527344, "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-18T13:42:59.497708Z", "completed_at": "2023-09-18T13:42:59.513566Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.513566Z", "completed_at": "2023-09-18T13:42:59.513566Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.047672271728515625, "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-18T13:42:59.513566Z", "completed_at": "2023-09-18T13:42:59.529647Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.545340Z", "completed_at": "2023-09-18T13:42:59.545340Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.039281606674194336, "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-18T13:42:59.529647Z", "completed_at": "2023-09-18T13:42:59.545340Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.552847Z", "completed_at": "2023-09-18T13:42:59.552847Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.032311201095581055, "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-18T13:42:59.545340Z", "completed_at": "2023-09-18T13:42:59.552847Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.561958Z", "completed_at": "2023-09-18T13:42:59.561958Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.032311201095581055, "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-18T13:42:59.552847Z", "completed_at": "2023-09-18T13:42:59.552847Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.561958Z", "completed_at": "2023-09-18T13:42:59.561958Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04846382141113281, "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-18T13:42:59.552847Z", "completed_at": "2023-09-18T13:42:59.561958Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.578111Z", "completed_at": "2023-09-18T13:42:59.578111Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.025263071060180664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.561958Z", "completed_at": "2023-09-18T13:42:59.578111Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.578111Z", "completed_at": "2023-09-18T13:42:59.578111Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031160354614257812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.578111Z", "completed_at": "2023-09-18T13:42:59.578111Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.624517Z", "completed_at": "2023-09-18T13:42:59.624517Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04640626907348633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.578111Z", "completed_at": "2023-09-18T13:42:59.624517Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.624517Z", "completed_at": "2023-09-18T13:42:59.624517Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.11020874977111816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.593118Z", "completed_at": "2023-09-18T13:42:59.624517Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.688319Z", "completed_at": "2023-09-18T13:42:59.688319Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.12599849700927734, "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-18T13:42:59.593118Z", "completed_at": "2023-09-18T13:42:59.624517Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.688319Z", "completed_at": "2023-09-18T13:42:59.688319Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.12599849700927734, "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-18T13:42:59.624517Z", "completed_at": "2023-09-18T13:42:59.704109Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.704109Z", "completed_at": "2023-09-18T13:42:59.704109Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07959222793579102, "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-18T13:42:59.704109Z", "completed_at": "2023-09-18T13:42:59.704109Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.719856Z", "completed_at": "2023-09-18T13:42:59.719856Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.047536373138427734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.704109Z", "completed_at": "2023-09-18T13:42:59.719856Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.735856Z", "completed_at": "2023-09-18T13:42:59.735856Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031746625900268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.719856Z", "completed_at": "2023-09-18T13:42:59.719856Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.735856Z", "completed_at": "2023-09-18T13:42:59.735856Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031746625900268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:42:59.719856Z", "completed_at": "2023-09-18T13:42:59.735856Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.735856Z", "completed_at": "2023-09-18T13:42:59.735856Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031746625900268555, "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-18T13:42:59.735856Z", "completed_at": "2023-09-18T13:42:59.735856Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.767447Z", "completed_at": "2023-09-18T13:42:59.767447Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05145597457885742, "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-18T13:42:59.752296Z", "completed_at": "2023-09-18T13:42:59.771312Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.788928Z", "completed_at": "2023-09-18T13:42:59.788928Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.053072214126586914, "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-18T13:42:59.771312Z", "completed_at": "2023-09-18T13:42:59.784435Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.788928Z", "completed_at": "2023-09-18T13:42:59.788928Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.06425189971923828, "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-18T13:42:59.771312Z", "completed_at": "2023-09-18T13:42:59.788928Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.800108Z", "completed_at": "2023-09-18T13:42:59.800108Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.048433542251586914, "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-18T13:42:59.784435Z", "completed_at": "2023-09-18T13:42:59.788928Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.800108Z", "completed_at": "2023-09-18T13:42:59.800108Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.032660484313964844, "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-18T13:42:59.788928Z", "completed_at": "2023-09-18T13:42:59.800108Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.816362Z", "completed_at": "2023-09-18T13:42:59.816362Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.030564069747924805, "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-18T13:42:59.800108Z", "completed_at": "2023-09-18T13:42:59.819492Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.863458Z", "completed_at": "2023-09-18T13:42:59.863458Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06335043907165527, "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-18T13:42:59.820598Z", "completed_at": "2023-09-18T13:42:59.863458Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.863458Z", "completed_at": "2023-09-18T13:42:59.863458Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07930946350097656, "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-18T13:42:59.852876Z", "completed_at": "2023-09-18T13:42:59.863458Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.879417Z", "completed_at": "2023-09-18T13:42:59.879417Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.061948299407958984, "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-18T13:42:59.863458Z", "completed_at": "2023-09-18T13:42:59.863458Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.879417Z", "completed_at": "2023-09-18T13:42:59.879417Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06094217300415039, "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-18T13:42:59.863458Z", "completed_at": "2023-09-18T13:42:59.879417Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.879417Z", "completed_at": "2023-09-18T13:42:59.879417Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03175473213195801, "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-18T13:42:59.879417Z", "completed_at": "2023-09-18T13:42:59.895213Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.911781Z", "completed_at": "2023-09-18T13:42:59.911781Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0323636531829834, "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-18T13:42:59.895213Z", "completed_at": "2023-09-18T13:42:59.911781Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.911781Z", "completed_at": "2023-09-18T13:42:59.911781Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.047870635986328125, "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-18T13:42:59.895213Z", "completed_at": "2023-09-18T13:42:59.911781Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.911781Z", "completed_at": "2023-09-18T13:42:59.911781Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.047870635986328125, "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-18T13:42:59.895213Z", "completed_at": "2023-09-18T13:42:59.911781Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.911781Z", "completed_at": "2023-09-18T13:42:59.911781Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.032074928283691406, "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-18T13:42:59.911781Z", "completed_at": "2023-09-18T13:42:59.911781Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.927288Z", "completed_at": "2023-09-18T13:42:59.927288Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015506982803344727, "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-18T13:42:59.927288Z", "completed_at": "2023-09-18T13:42:59.927288Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.952922Z", "completed_at": "2023-09-18T13:42:59.952922Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04714822769165039, "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-18T13:42:59.927288Z", "completed_at": "2023-09-18T13:42:59.958929Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.958929Z", "completed_at": "2023-09-18T13:42:59.958929Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031641244888305664, "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-18T13:42:59.942916Z", "completed_at": "2023-09-18T13:42:59.958929Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.958929Z", "completed_at": "2023-09-18T13:42:59.958929Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031641244888305664, "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-18T13:42:59.942916Z", "completed_at": "2023-09-18T13:42:59.958929Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.958929Z", "completed_at": "2023-09-18T13:42:59.958929Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031641244888305664, "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-18T13:42:59.958929Z", "completed_at": "2023-09-18T13:42:59.958929Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.958929Z", "completed_at": "2023-09-18T13:42:59.958929Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031795501708984375, "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-18T13:42:59.974711Z", "completed_at": "2023-09-18T13:42:59.974711Z"}, {"name": "execute", "started_at": "2023-09-18T13:42:59.990806Z", "completed_at": "2023-09-18T13:42:59.990806Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03187704086303711, "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-18T13:42:59.990806Z", "completed_at": "2023-09-18T13:42:59.990806Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.022397Z", "completed_at": "2023-09-18T13:43:00.022397Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04768538475036621, "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-18T13:42:59.974711Z", "completed_at": "2023-09-18T13:42:59.990806Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.019798Z", "completed_at": "2023-09-18T13:43:00.019798Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04567313194274902, "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-18T13:42:59.974711Z", "completed_at": "2023-09-18T13:42:59.990806Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.017597Z", "completed_at": "2023-09-18T13:43:00.017597Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04768538475036621, "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-18T13:42:59.990806Z", "completed_at": "2023-09-18T13:43:00.015970Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.022397Z", "completed_at": "2023-09-18T13:43:00.022397Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04768538475036621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.022397Z", "completed_at": "2023-09-18T13:43:00.022397Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.038025Z", "completed_at": "2023-09-18T13:43:00.038025Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.022887468338012695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.041679Z", "completed_at": "2023-09-18T13:43:00.053852Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.058883Z", "completed_at": "2023-09-18T13:43:00.058883Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.036486148834228516, "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-18T13:43:00.041679Z", "completed_at": "2023-09-18T13:43:00.058883Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.058883Z", "completed_at": "2023-09-18T13:43:00.058883Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05262422561645508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.053852Z", "completed_at": "2023-09-18T13:43:00.058883Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.073010Z", "completed_at": "2023-09-18T13:43:00.073010Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03533506393432617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.058883Z", "completed_at": "2023-09-18T13:43:00.058883Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.075021Z", "completed_at": "2023-09-18T13:43:00.075021Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03533506393432617, "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-18T13:43:00.058883Z", "completed_at": "2023-09-18T13:43:00.077014Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.082908Z", "completed_at": "2023-09-18T13:43:00.082908Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03421807289123535, "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-18T13:43:00.082908Z", "completed_at": "2023-09-18T13:43:00.093101Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.101769Z", "completed_at": "2023-09-18T13:43:00.101769Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.024755239486694336, "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-18T13:43:00.093101Z", "completed_at": "2023-09-18T13:43:00.101769Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.101769Z", "completed_at": "2023-09-18T13:43:00.101769Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0407261848449707, "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-18T13:43:00.101769Z", "completed_at": "2023-09-18T13:43:00.101769Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.117740Z", "completed_at": "2023-09-18T13:43:00.117740Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.024639606475830078, "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-18T13:43:00.134590Z", "completed_at": "2023-09-18T13:43:00.152907Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.152907Z", "completed_at": "2023-09-18T13:43:00.152907Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.048172950744628906, "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-18T13:43:00.134590Z", "completed_at": "2023-09-18T13:43:00.152907Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.152907Z", "completed_at": "2023-09-18T13:43:00.152907Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.032073259353637695, "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-18T13:43:00.152907Z", "completed_at": "2023-09-18T13:43:00.152907Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.165913Z", "completed_at": "2023-09-18T13:43:00.165913Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03132367134094238, "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-18T13:43:00.165913Z", "completed_at": "2023-09-18T13:43:00.165913Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.181815Z", "completed_at": "2023-09-18T13:43:00.181815Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04467272758483887, "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-18T13:43:00.165913Z", "completed_at": "2023-09-18T13:43:00.165913Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.181815Z", "completed_at": "2023-09-18T13:43:00.181815Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04467272758483887, "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-18T13:43:00.181815Z", "completed_at": "2023-09-18T13:43:00.197580Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.197580Z", "completed_at": "2023-09-18T13:43:00.197580Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04772353172302246, "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-18T13:43:00.247605Z", "completed_at": "2023-09-18T13:43:00.255637Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.279424Z", "completed_at": "2023-09-18T13:43:00.279424Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04230809211730957, "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-18T13:43:00.255637Z", "completed_at": "2023-09-18T13:43:00.279424Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.282029Z", "completed_at": "2023-09-18T13:43:00.282029Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0344240665435791, "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-18T13:43:00.263799Z", "completed_at": "2023-09-18T13:43:00.282029Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.282029Z", "completed_at": "2023-09-18T13:43:00.282029Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02639293670654297, "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-18T13:43:00.263799Z", "completed_at": "2023-09-18T13:43:00.282029Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.282029Z", "completed_at": "2023-09-18T13:43:00.282029Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04206132888793945, "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-18T13:43:00.279424Z", "completed_at": "2023-09-18T13:43:00.282029Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.297698Z", "completed_at": "2023-09-18T13:43:00.297698Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.033898353576660156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.297698Z", "completed_at": "2023-09-18T13:43:00.297698Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.313437Z", "completed_at": "2023-09-18T13:43:00.313437Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04731559753417969, "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-18T13:43:00.297698Z", "completed_at": "2023-09-18T13:43:00.313437Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.329345Z", "completed_at": "2023-09-18T13:43:00.329345Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0316472053527832, "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-18T13:43:00.313437Z", "completed_at": "2023-09-18T13:43:00.313437Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.329345Z", "completed_at": "2023-09-18T13:43:00.329345Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0316472053527832, "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-18T13:43:00.313437Z", "completed_at": "2023-09-18T13:43:00.329345Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.329345Z", "completed_at": "2023-09-18T13:43:00.329345Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0316472053527832, "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-18T13:43:00.313437Z", "completed_at": "2023-09-18T13:43:00.329345Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.329345Z", "completed_at": "2023-09-18T13:43:00.329345Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01590752601623535, "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-18T13:43:00.329345Z", "completed_at": "2023-09-18T13:43:00.353224Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.361839Z", "completed_at": "2023-09-18T13:43:00.361839Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.032494306564331055, "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-18T13:43:00.353224Z", "completed_at": "2023-09-18T13:43:00.361839Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.361839Z", "completed_at": "2023-09-18T13:43:00.361839Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04801487922668457, "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-18T13:43:00.353224Z", "completed_at": "2023-09-18T13:43:00.361839Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.377360Z", "completed_at": "2023-09-18T13:43:00.377360Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.032143354415893555, "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-18T13:43:00.361839Z", "completed_at": "2023-09-18T13:43:00.361839Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.377360Z", "completed_at": "2023-09-18T13:43:00.377360Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.024136066436767578, "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-18T13:43:00.377360Z", "completed_at": "2023-09-18T13:43:00.392994Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.417395Z", "completed_at": "2023-09-18T13:43:00.417395Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04754018783569336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.377360Z", "completed_at": "2023-09-18T13:43:00.417395Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.424900Z", "completed_at": "2023-09-18T13:43:00.424900Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04754018783569336, "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-18T13:43:00.392994Z", "completed_at": "2023-09-18T13:43:00.417395Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.424900Z", "completed_at": "2023-09-18T13:43:00.424900Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04754018783569336, "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-18T13:43:00.392994Z", "completed_at": "2023-09-18T13:43:00.417395Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.424900Z", "completed_at": "2023-09-18T13:43:00.424900Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04754018783569336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.417395Z", "completed_at": "2023-09-18T13:43:00.424900Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.424900Z", "completed_at": "2023-09-18T13:43:00.424900Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0319056510925293, "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-18T13:43:00.424900Z", "completed_at": "2023-09-18T13:43:00.440986Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.456999Z", "completed_at": "2023-09-18T13:43:00.456999Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03209829330444336, "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-18T13:43:00.440986Z", "completed_at": "2023-09-18T13:43:00.456999Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.456999Z", "completed_at": "2023-09-18T13:43:00.456999Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03209829330444336, "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-18T13:43:00.440986Z", "completed_at": "2023-09-18T13:43:00.456999Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.456999Z", "completed_at": "2023-09-18T13:43:00.456999Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03209829330444336, "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-18T13:43:00.453492Z", "completed_at": "2023-09-18T13:43:00.456999Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.456999Z", "completed_at": "2023-09-18T13:43:00.456999Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03209829330444336, "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-18T13:43:00.456999Z", "completed_at": "2023-09-18T13:43:00.456999Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.472944Z", "completed_at": "2023-09-18T13:43:00.472944Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03195786476135254, "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-18T13:43:00.472944Z", "completed_at": "2023-09-18T13:43:00.504596Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.504596Z", "completed_at": "2023-09-18T13:43:00.504596Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.047597408294677734, "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-18T13:43:00.488884Z", "completed_at": "2023-09-18T13:43:00.504596Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.504596Z", "completed_at": "2023-09-18T13:43:00.504596Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031652212142944336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.504596Z", "completed_at": "2023-09-18T13:43:00.504596Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.504596Z", "completed_at": "2023-09-18T13:43:00.504596Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031652212142944336, "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-18T13:43:00.520443Z", "completed_at": "2023-09-18T13:43:00.584477Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.584477Z", "completed_at": "2023-09-18T13:43:00.584477Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06403470039367676, "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-18T13:43:00.584477Z", "completed_at": "2023-09-18T13:43:00.600457Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.600457Z", "completed_at": "2023-09-18T13:43:00.600457Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031618595123291016, "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-18T13:43:00.600457Z", "completed_at": "2023-09-18T13:43:00.616096Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.616096Z", "completed_at": "2023-09-18T13:43:00.616096Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031618595123291016, "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-18T13:43:00.616096Z", "completed_at": "2023-09-18T13:43:00.616096Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.616096Z", "completed_at": "2023-09-18T13:43:00.616096Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0, "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-18T13:43:00.616096Z", "completed_at": "2023-09-18T13:43:00.632207Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.632207Z", "completed_at": "2023-09-18T13:43:00.632207Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016110658645629883, "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-18T13:43:00.632207Z", "completed_at": "2023-09-18T13:43:00.653990Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.653990Z", "completed_at": "2023-09-18T13:43:00.653990Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02178359031677246, "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-18T13:43:00.653990Z", "completed_at": "2023-09-18T13:43:00.696122Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.696122Z", "completed_at": "2023-09-18T13:43:00.696122Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04213142395019531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.653990Z", "completed_at": "2023-09-18T13:43:00.696122Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.696122Z", "completed_at": "2023-09-18T13:43:00.696122Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04213142395019531, "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-18T13:43:00.680092Z", "completed_at": "2023-09-18T13:43:00.696122Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.696122Z", "completed_at": "2023-09-18T13:43:00.696122Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04213142395019531, "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-18T13:43:00.727836Z", "completed_at": "2023-09-18T13:43:00.745094Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.753885Z", "completed_at": "2023-09-18T13:43:00.753885Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.041846275329589844, "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-18T13:43:00.712038Z", "completed_at": "2023-09-18T13:43:00.745094Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.753885Z", "completed_at": "2023-09-18T13:43:00.753885Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.041846275329589844, "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-18T13:43:00.728482Z", "completed_at": "2023-09-18T13:43:00.745094Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.753885Z", "completed_at": "2023-09-18T13:43:00.753885Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.041846275329589844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.728482Z", "completed_at": "2023-09-18T13:43:00.745094Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.753885Z", "completed_at": "2023-09-18T13:43:00.753885Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04735112190246582, "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-18T13:43:00.728482Z", "completed_at": "2023-09-18T13:43:00.753885Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.753885Z", "completed_at": "2023-09-18T13:43:00.753885Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04735112190246582, "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-18T13:43:00.843045Z", "completed_at": "2023-09-18T13:43:00.858356Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.858356Z", "completed_at": "2023-09-18T13:43:00.858356Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.11489987373352051, "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-18T13:43:00.759390Z", "completed_at": "2023-09-18T13:43:00.858356Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.858356Z", "completed_at": "2023-09-18T13:43:00.858356Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11489987373352051, "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-18T13:43:00.874289Z", "completed_at": "2023-09-18T13:43:00.890035Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03171491622924805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.874289Z", "completed_at": "2023-09-18T13:43:00.906005Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03171491622924805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.890035Z", "completed_at": "2023-09-18T13:43:00.906005Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04781508445739746, "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-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04846596717834473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.906005Z", "completed_at": "2023-09-18T13:43:00.906005Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04846596717834473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:00.922755Z", "completed_at": "2023-09-18T13:43:00.954002Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.954002Z", "completed_at": "2023-09-18T13:43:00.954002Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031246185302734375, "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-18T13:43:00.938207Z", "completed_at": "2023-09-18T13:43:00.954002Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.954002Z", "completed_at": "2023-09-18T13:43:00.954002Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.031246185302734375, "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-18T13:43:00.922755Z", "completed_at": "2023-09-18T13:43:00.954002Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.954002Z", "completed_at": "2023-09-18T13:43:00.954002Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031246185302734375, "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-18T13:43:00.938207Z", "completed_at": "2023-09-18T13:43:00.954002Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:00.954002Z", "completed_at": "2023-09-18T13:43:00.954002Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031246185302734375, "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-18T13:43:01.002054Z", "completed_at": "2023-09-18T13:43:01.002054Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.018086Z", "completed_at": "2023-09-18T13:43:01.018086Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03206515312194824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__stg_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.018086Z", "completed_at": "2023-09-18T13:43:01.065659Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.116150Z", "completed_at": "2023-09-18T13:43:01.116150Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11082267761230469, "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-18T13:43:01.033945Z", "completed_at": "2023-09-18T13:43:01.116150Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.128909Z", "completed_at": "2023-09-18T13:43:01.128909Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.11082267761230469, "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-18T13:43:01.116150Z", "completed_at": "2023-09-18T13:43:01.128909Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.128909Z", "completed_at": "2023-09-18T13:43:01.128909Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.09496426582336426, "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-18T13:43:01.065659Z", "completed_at": "2023-09-18T13:43:01.128909Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.128909Z", "completed_at": "2023-09-18T13:43:01.128909Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.11082267761230469, "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-18T13:43:01.116150Z", "completed_at": "2023-09-18T13:43:01.128909Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.128909Z", "completed_at": "2023-09-18T13:43:01.128909Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09496426582336426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.128909Z", "completed_at": "2023-09-18T13:43:01.144927Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.240190Z", "completed_at": "2023-09-18T13:43:01.240190Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.1112813949584961, "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-18T13:43:01.144927Z", "completed_at": "2023-09-18T13:43:01.208102Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.240190Z", "completed_at": "2023-09-18T13:43:01.240190Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1112813949584961, "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-18T13:43:01.176646Z", "completed_at": "2023-09-18T13:43:01.240190Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.240190Z", "completed_at": "2023-09-18T13:43:01.240190Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.10977578163146973, "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-18T13:43:01.208102Z", "completed_at": "2023-09-18T13:43:01.240190Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.240190Z", "completed_at": "2023-09-18T13:43:01.240190Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.1112825870513916, "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-18T13:43:01.240190Z", "completed_at": "2023-09-18T13:43:01.240190Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.254703Z", "completed_at": "2023-09-18T13:43:01.254703Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.1112825870513916, "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-18T13:43:01.256210Z", "completed_at": "2023-09-18T13:43:01.256210Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.303797Z", "completed_at": "2023-09-18T13:43:01.303797Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06360697746276855, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.256210Z", "completed_at": "2023-09-18T13:43:01.272219Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.323107Z", "completed_at": "2023-09-18T13:43:01.323107Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06689739227294922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_primary_dx_per_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.307477Z", "completed_at": "2023-09-18T13:43:01.323107Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.323107Z", "completed_at": "2023-09-18T13:43:01.323107Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0508885383605957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.272219Z", "completed_at": "2023-09-18T13:43:01.323107Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.323107Z", "completed_at": "2023-09-18T13:43:01.323107Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06689739227294922, "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-18T13:43:01.323107Z", "completed_at": "2023-09-18T13:43:01.434857Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.466959Z", "completed_at": "2023-09-18T13:43:01.466959Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.20646142959594727, "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-18T13:43:01.341018Z", "completed_at": "2023-09-18T13:43:01.434857Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.529569Z", "completed_at": "2023-09-18T13:43:01.529569Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.21110224723815918, "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-18T13:43:01.434857Z", "completed_at": "2023-09-18T13:43:01.529569Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.534209Z", "completed_at": "2023-09-18T13:43:01.534209Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.09935235977172852, "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-18T13:43:01.468177Z", "completed_at": "2023-09-18T13:43:01.534209Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.534209Z", "completed_at": "2023-09-18T13:43:01.534209Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.12010812759399414, "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-18T13:43:01.534209Z", "completed_at": "2023-09-18T13:43:01.593048Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.593048Z", "completed_at": "2023-09-18T13:43:01.593048Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.15549993515014648, "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-18T13:43:01.561472Z", "completed_at": "2023-09-18T13:43:01.593048Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.689709Z", "completed_at": "2023-09-18T13:43:01.689709Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.15549993515014648, "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-18T13:43:01.593048Z", "completed_at": "2023-09-18T13:43:01.689709Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.689709Z", "completed_at": "2023-09-18T13:43:01.689709Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.09666109085083008, "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-18T13:43:01.625812Z", "completed_at": "2023-09-18T13:43:01.689709Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.689709Z", "completed_at": "2023-09-18T13:43:01.689709Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09666109085083008, "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-18T13:43:01.689709Z", "completed_at": "2023-09-18T13:43:01.705173Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.705173Z", "completed_at": "2023-09-18T13:43:01.705173Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06664013862609863, "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-18T13:43:01.705173Z", "completed_at": "2023-09-18T13:43:01.764548Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.769901Z", "completed_at": "2023-09-18T13:43:01.769901Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06573295593261719, "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-18T13:43:01.756349Z", "completed_at": "2023-09-18T13:43:01.764548Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.770906Z", "completed_at": "2023-09-18T13:43:01.770906Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06573295593261719, "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-18T13:43:01.770906Z", "completed_at": "2023-09-18T13:43:01.770906Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.784412Z", "completed_at": "2023-09-18T13:43:01.784412Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0158538818359375, "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-18T13:43:01.784412Z", "completed_at": "2023-09-18T13:43:01.784412Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.784412Z", "completed_at": "2023-09-18T13:43:01.784412Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.013506174087524414, "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-18T13:43:01.784412Z", "completed_at": "2023-09-18T13:43:01.784412Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.800251Z", "completed_at": "2023-09-18T13:43:01.800251Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.029345273971557617, "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-18T13:43:01.800251Z", "completed_at": "2023-09-18T13:43:01.800251Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.800251Z", "completed_at": "2023-09-18T13:43:01.800251Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015839099884033203, "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-18T13:43:01.800251Z", "completed_at": "2023-09-18T13:43:01.800251Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.815876Z", "completed_at": "2023-09-18T13:43:01.815876Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.018337011337280273, "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-18T13:43:01.800251Z", "completed_at": "2023-09-18T13:43:01.815876Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.818588Z", "completed_at": "2023-09-18T13:43:01.818588Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018337011337280273, "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-18T13:43:01.818588Z", "completed_at": "2023-09-18T13:43:01.818588Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.834785Z", "completed_at": "2023-09-18T13:43:01.834785Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016196250915527344, "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-18T13:43:01.818588Z", "completed_at": "2023-09-18T13:43:01.834785Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.834785Z", "completed_at": "2023-09-18T13:43:01.834785Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016196250915527344, "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-18T13:43:01.834785Z", "completed_at": "2023-09-18T13:43:01.834785Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.834785Z", "completed_at": "2023-09-18T13:43:01.834785Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016196250915527344, "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-18T13:43:01.834785Z", "completed_at": "2023-09-18T13:43:01.855806Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.866316Z", "completed_at": "2023-09-18T13:43:01.866316Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031531333923339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_merge_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.866316Z", "completed_at": "2023-09-18T13:43:01.866316Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.882375Z", "completed_at": "2023-09-18T13:43:01.882375Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.032076120376586914, "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-18T13:43:01.882375Z", "completed_at": "2023-09-18T13:43:01.898496Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.898496Z", "completed_at": "2023-09-18T13:43:01.898496Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01612114906311035, "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-18T13:43:01.898496Z", "completed_at": "2023-09-18T13:43:01.898496Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.898496Z", "completed_at": "2023-09-18T13:43:01.898496Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01612114906311035, "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-18T13:43:01.898496Z", "completed_at": "2023-09-18T13:43:01.914574Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.914574Z", "completed_at": "2023-09-18T13:43:01.914574Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01607799530029297, "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-18T13:43:01.914574Z", "completed_at": "2023-09-18T13:43:01.914574Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.914574Z", "completed_at": "2023-09-18T13:43:01.914574Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0, "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-18T13:43:01.914574Z", "completed_at": "2023-09-18T13:43:01.930547Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.930547Z", "completed_at": "2023-09-18T13:43:01.930547Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01597309112548828, "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-18T13:43:01.930547Z", "completed_at": "2023-09-18T13:43:01.941617Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.941617Z", "completed_at": "2023-09-18T13:43:01.941617Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01607656478881836, "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-18T13:43:01.941617Z", "completed_at": "2023-09-18T13:43:01.946624Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.946624Z", "completed_at": "2023-09-18T13:43:01.946624Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01607656478881836, "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-18T13:43:01.946624Z", "completed_at": "2023-09-18T13:43:01.956130Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.962637Z", "completed_at": "2023-09-18T13:43:01.962637Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016013383865356445, "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-18T13:43:01.956130Z", "completed_at": "2023-09-18T13:43:01.975948Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.978455Z", "completed_at": "2023-09-18T13:43:01.978455Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03183102607727051, "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-18T13:43:01.288070Z", "completed_at": "2023-09-18T13:43:01.882375Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.882375Z", "completed_at": "2023-09-18T13:43:01.882375Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.7388641834259033, "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-18T13:43:01.978455Z", "completed_at": "2023-09-18T13:43:01.978455Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.995074Z", "completed_at": "2023-09-18T13:43:01.995074Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016618967056274414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.978455Z", "completed_at": "2023-09-18T13:43:01.995074Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:01.995074Z", "completed_at": "2023-09-18T13:43:01.995074Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016618967056274414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_class"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.995074Z", "completed_at": "2023-09-18T13:43:02.009912Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.041312Z", "completed_at": "2023-09-18T13:43:02.041312Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04623866081237793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__unclassified_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.995074Z", "completed_at": "2023-09-18T13:43:02.009912Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.041312Z", "completed_at": "2023-09-18T13:43:02.041312Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.061249494552612305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__unclassified_rows"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.009912Z", "completed_at": "2023-09-18T13:43:02.041312Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.059668Z", "completed_at": "2023-09-18T13:43:02.059668Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04975605010986328, "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-18T13:43:02.059668Z", "completed_at": "2023-09-18T13:43:02.073175Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.073175Z", "completed_at": "2023-09-18T13:43:02.073175Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02614593505859375, "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-18T13:43:02.073175Z", "completed_at": "2023-09-18T13:43:02.083978Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.097397Z", "completed_at": "2023-09-18T13:43:02.097397Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.024222135543823242, "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-18T13:43:02.100662Z", "completed_at": "2023-09-18T13:43:02.105398Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.105398Z", "completed_at": "2023-09-18T13:43:02.105398Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.00800013542175293, "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-18T13:43:02.105398Z", "completed_at": "2023-09-18T13:43:02.105398Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.121483Z", "completed_at": "2023-09-18T13:43:02.121483Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01608562469482422, "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-18T13:43:02.105398Z", "completed_at": "2023-09-18T13:43:02.121483Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.203268Z", "completed_at": "2023-09-18T13:43:02.203268Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.19077730178833008, "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-18T13:43:01.689709Z", "completed_at": "2023-09-18T13:43:02.100662Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.105398Z", "completed_at": "2023-09-18T13:43:02.105398Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.6064655780792236, "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-18T13:43:02.121483Z", "completed_at": "2023-09-18T13:43:02.203268Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.296175Z", "completed_at": "2023-09-18T13:43:02.296175Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.17469167709350586, "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-18T13:43:02.311913Z", "completed_at": "2023-09-18T13:43:02.331128Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.331128Z", "completed_at": "2023-09-18T13:43:02.331128Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03495311737060547, "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-18T13:43:02.311913Z", "completed_at": "2023-09-18T13:43:02.331128Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.331128Z", "completed_at": "2023-09-18T13:43:02.331128Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03495311737060547, "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-18T13:43:02.331128Z", "completed_at": "2023-09-18T13:43:02.331128Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.331128Z", "completed_at": "2023-09-18T13:43:02.331128Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01750969886779785, "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-18T13:43:02.346134Z", "completed_at": "2023-09-18T13:43:02.356641Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.361993Z", "completed_at": "2023-09-18T13:43:02.361993Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03086543083190918, "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-18T13:43:02.346134Z", "completed_at": "2023-09-18T13:43:02.357986Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.361993Z", "completed_at": "2023-09-18T13:43:02.361993Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03086543083190918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.357986Z", "completed_at": "2023-09-18T13:43:02.361993Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.361993Z", "completed_at": "2023-09-18T13:43:02.361993Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015858888626098633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:01.855806Z", "completed_at": "2023-09-18T13:43:02.296175Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.311913Z", "completed_at": "2023-09-18T13:43:02.311913Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.5744199752807617, "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-18T13:43:02.361993Z", "completed_at": "2023-09-18T13:43:02.409205Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.409205Z", "completed_at": "2023-09-18T13:43:02.409205Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0472111701965332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.393244Z", "completed_at": "2023-09-18T13:43:02.409205Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.409205Z", "completed_at": "2023-09-18T13:43:02.409205Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0472111701965332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_patient_list"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.409205Z", "completed_at": "2023-09-18T13:43:02.409205Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.409205Z", "completed_at": "2023-09-18T13:43:02.409205Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01686406135559082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.409205Z", "completed_at": "2023-09-18T13:43:02.440576Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.457218Z", "completed_at": "2023-09-18T13:43:02.457218Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04801368713378906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.426069Z", "completed_at": "2023-09-18T13:43:02.456712Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.457218Z", "completed_at": "2023-09-18T13:43:02.457218Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04801368713378906, "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-18T13:43:02.440576Z", "completed_at": "2023-09-18T13:43:02.457218Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.457218Z", "completed_at": "2023-09-18T13:43:02.457218Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0461583137512207, "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-18T13:43:02.457218Z", "completed_at": "2023-09-18T13:43:02.457218Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.472227Z", "completed_at": "2023-09-18T13:43:02.472227Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015008687973022461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.472227Z", "completed_at": "2023-09-18T13:43:02.472227Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.487858Z", "completed_at": "2023-09-18T13:43:02.487858Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.030640125274658203, "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-18T13:43:02.472227Z", "completed_at": "2023-09-18T13:43:02.487858Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.487858Z", "completed_at": "2023-09-18T13:43:02.487858Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015631437301635742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.472227Z", "completed_at": "2023-09-18T13:43:02.487858Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.487858Z", "completed_at": "2023-09-18T13:43:02.487858Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.015631437301635742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__claim_categorization"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.487858Z", "completed_at": "2023-09-18T13:43:02.487858Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.487858Z", "completed_at": "2023-09-18T13:43:02.487858Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015867233276367188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.487858Z", "completed_at": "2023-09-18T13:43:02.519649Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.710310Z", "completed_at": "2023-09-18T13:43:02.710310Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.22245192527770996, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.503726Z", "completed_at": "2023-09-18T13:43:02.662470Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.710310Z", "completed_at": "2023-09-18T13:43:02.710310Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.22245192527770996, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.710310Z", "completed_at": "2023-09-18T13:43:02.710310Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.725927Z", "completed_at": "2023-09-18T13:43:02.725927Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.22220134735107422, "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-18T13:43:02.710310Z", "completed_at": "2023-09-18T13:43:02.725927Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.741965Z", "completed_at": "2023-09-18T13:43:02.741965Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03165483474731445, "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-18T13:43:02.725927Z", "completed_at": "2023-09-18T13:43:02.741965Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.741965Z", "completed_at": "2023-09-18T13:43:02.741965Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.032060861587524414, "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-18T13:43:02.741965Z", "completed_at": "2023-09-18T13:43:02.741965Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.757988Z", "completed_at": "2023-09-18T13:43:02.757988Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.032060861587524414, "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-18T13:43:02.741965Z", "completed_at": "2023-09-18T13:43:02.757988Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.757988Z", "completed_at": "2023-09-18T13:43:02.757988Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016022682189941406, "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-18T13:43:02.757988Z", "completed_at": "2023-09-18T13:43:02.773769Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.773769Z", "completed_at": "2023-09-18T13:43:02.773769Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031812429428100586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.773769Z", "completed_at": "2023-09-18T13:43:02.773769Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.789800Z", "completed_at": "2023-09-18T13:43:02.789800Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031812429428100586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_ccs_description"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.773769Z", "completed_at": "2023-09-18T13:43:02.789800Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.789800Z", "completed_at": "2023-09-18T13:43:02.789800Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016031503677368164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_patient_race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.773769Z", "completed_at": "2023-09-18T13:43:02.789800Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.789800Z", "completed_at": "2023-09-18T13:43:02.789800Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016031503677368164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_parent_organization"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.789800Z", "completed_at": "2023-09-18T13:43:02.805498Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.805498Z", "completed_at": "2023-09-18T13:43:02.805498Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03137636184692383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_practice_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.805498Z", "completed_at": "2023-09-18T13:43:02.805498Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.821177Z", "completed_at": "2023-09-18T13:43:02.821177Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03137636184692383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_year"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.059668Z", "completed_at": "2023-09-18T13:43:02.710310Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.725927Z", "completed_at": "2023-09-18T13:43:02.725927Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.7623133659362793, "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-18T13:43:02.805498Z", "completed_at": "2023-09-18T13:43:02.821177Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.821177Z", "completed_at": "2023-09-18T13:43:02.821177Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.015678882598876953, "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-18T13:43:02.805498Z", "completed_at": "2023-09-18T13:43:02.821177Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.821177Z", "completed_at": "2023-09-18T13:43:02.821177Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031629323959350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_year_month"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.821177Z", "completed_at": "2023-09-18T13:43:02.837127Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.837127Z", "completed_at": "2023-09-18T13:43:02.837127Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03568077087402344, "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-18T13:43:02.837127Z", "completed_at": "2023-09-18T13:43:02.856857Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.856857Z", "completed_at": "2023-09-18T13:43:02.856857Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03568077087402344, "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-18T13:43:02.837127Z", "completed_at": "2023-09-18T13:43:02.856857Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.856857Z", "completed_at": "2023-09-18T13:43:02.856857Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.019730329513549805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-18T13:43:02.852887Z", "completed_at": "2023-09-18T13:43:02.856857Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.856857Z", "completed_at": "2023-09-18T13:43:02.856857Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.019730329513549805, "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-18T13:43:02.856857Z", "completed_at": "2023-09-18T13:43:02.856857Z"}, {"name": "execute", "started_at": "2023-09-18T13:43:02.856857Z", "completed_at": "2023-09-18T13:43:02.856857Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.019730329513549805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"}], "elapsed_time": 6.200177431106567, "args": {"version_check": true, "indirect_selection": "eager", "log_level": "info", "partial_parse": true, "print": true, "profiles_dir": "C:\\Users\\thuxuan\\PycharmProjects", "log_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate\\..\\logs", "use_colors": true, "favor_state": false, "vars": {}, "log_level_file": "debug", "send_anonymous_usage_stats": true, "exclude": [], "use_colors_file": true, "log_format_file": "debug", "log_format": "default", "static_parser": true, "warn_error_options": {"include": [], "exclude": []}, "populate_cache": true, "cache_selected_only": false, "compile": true, "strict_mode": false, "macro_debugging": false, "enable_legacy_logger": false, "defer": false, "select": [], "introspect": true, "which": "generate", "write_json": true, "project_dir": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "printer_width": 80, "quiet": false}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.5.1", "generated_at": "2023-09-20T12:50:22.803502Z", "invocation_id": "a2f9bb74-6e78-4b20-b34d-c110dc64cef3", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:18.978473Z", "completed_at": "2023-09-20T12:50:18.984640Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:18.984640Z", "completed_at": "2023-09-20T12:50:18.984640Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.011393547058105469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:18.982478Z", "completed_at": "2023-09-20T12:50:18.984640Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:18.984640Z", "completed_at": "2023-09-20T12:50:18.984640Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.019948482513427734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:18.983487Z", "completed_at": "2023-09-20T12:50:18.984640Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:18.984640Z", "completed_at": "2023-09-20T12:50:18.984640Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02095818519592285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:18.984640Z", "completed_at": "2023-09-20T12:50:18.984640Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:18.992665Z", "completed_at": "2023-09-20T12:50:18.992665Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.02095818519592285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:18.984640Z", "completed_at": "2023-09-20T12:50:18.984640Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:18.993195Z", "completed_at": "2023-09-20T12:50:18.993195Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.023102283477783203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:18.996349Z", "completed_at": "2023-09-20T12:50:19.004395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.013438Z", "completed_at": "2023-09-20T12:50:19.013438Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.017088890075683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.003422Z", "completed_at": "2023-09-20T12:50:19.004395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.013438Z", "completed_at": "2023-09-20T12:50:19.013438Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017088890075683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.004395Z", "completed_at": "2023-09-20T12:50:19.004395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.013438Z", "completed_at": "2023-09-20T12:50:19.013438Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.017088890075683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.004395Z", "completed_at": "2023-09-20T12:50:19.004395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.013438Z", "completed_at": "2023-09-20T12:50:19.013438Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017088890075683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.004395Z", "completed_at": "2023-09-20T12:50:19.012410Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.013438Z", "completed_at": "2023-09-20T12:50:19.013438Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017088890075683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.024262Z", "completed_at": "2023-09-20T12:50:19.028284Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.033305Z", "completed_at": "2023-09-20T12:50:19.033305Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.010875701904296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.eligibility_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.028284Z", "completed_at": "2023-09-20T12:50:19.028284Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.033305Z", "completed_at": "2023-09-20T12:50:19.033305Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.010875701904296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.medical_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.024262Z", "completed_at": "2023-09-20T12:50:19.028284Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.033305Z", "completed_at": "2023-09-20T12:50:19.033305Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.019867420196533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.028284Z", "completed_at": "2023-09-20T12:50:19.028284Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.033305Z", "completed_at": "2023-09-20T12:50:19.033305Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.009866952896118164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.claims_data_model.pharmacy_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.024262Z", "completed_at": "2023-09-20T12:50:19.032296Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.033305Z", "completed_at": "2023-09-20T12:50:19.033305Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.019867420196533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.claims_data_model.procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.044463Z", "completed_at": "2023-09-20T12:50:19.044463Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.053515Z", "completed_at": "2023-09-20T12:50:19.053515Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02021002769470215, "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-20T12:50:19.044463Z", "completed_at": "2023-09-20T12:50:19.044463Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.053515Z", "completed_at": "2023-09-20T12:50:19.053515Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.02021002769470215, "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-20T12:50:19.044463Z", "completed_at": "2023-09-20T12:50:19.044463Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.053515Z", "completed_at": "2023-09-20T12:50:19.053515Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01102447509765625, "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-20T12:50:19.044463Z", "completed_at": "2023-09-20T12:50:19.050974Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.053515Z", "completed_at": "2023-09-20T12:50:19.053515Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01102447509765625, "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-20T12:50:19.050974Z", "completed_at": "2023-09-20T12:50:19.052506Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.053515Z", "completed_at": "2023-09-20T12:50:19.053515Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015819549560546875, "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-20T12:50:19.064222Z", "completed_at": "2023-09-20T12:50:19.064222Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.073242Z", "completed_at": "2023-09-20T12:50:19.073242Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.015932798385620117, "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-20T12:50:19.064222Z", "completed_at": "2023-09-20T12:50:19.064222Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.073242Z", "completed_at": "2023-09-20T12:50:19.073242Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01663351058959961, "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-20T12:50:19.064222Z", "completed_at": "2023-09-20T12:50:19.064222Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.073242Z", "completed_at": "2023-09-20T12:50:19.073242Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.013628005981445312, "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-20T12:50:19.064222Z", "completed_at": "2023-09-20T12:50:19.064222Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.073242Z", "completed_at": "2023-09-20T12:50:19.073242Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.013628005981445312, "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-20T12:50:19.064222Z", "completed_at": "2023-09-20T12:50:19.064222Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.075953Z", "completed_at": "2023-09-20T12:50:19.075953Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.012619733810424805, "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-20T12:50:19.083473Z", "completed_at": "2023-09-20T12:50:19.083473Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.091053Z", "completed_at": "2023-09-20T12:50:19.091053Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.018069744110107422, "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-20T12:50:19.083473Z", "completed_at": "2023-09-20T12:50:19.083473Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.093073Z", "completed_at": "2023-09-20T12:50:19.093073Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.018069744110107422, "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-20T12:50:19.083473Z", "completed_at": "2023-09-20T12:50:19.083473Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.093073Z", "completed_at": "2023-09-20T12:50:19.093073Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.018069744110107422, "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-20T12:50:19.083473Z", "completed_at": "2023-09-20T12:50:19.083473Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.093073Z", "completed_at": "2023-09-20T12:50:19.093073Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018069744110107422, "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-20T12:50:19.083473Z", "completed_at": "2023-09-20T12:50:19.083473Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.094022Z", "completed_at": "2023-09-20T12:50:19.094022Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.011559247970581055, "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-20T12:50:19.103077Z", "completed_at": "2023-09-20T12:50:19.103077Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.107086Z", "completed_at": "2023-09-20T12:50:19.107086Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01907801628112793, "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-20T12:50:19.103077Z", "completed_at": "2023-09-20T12:50:19.103077Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.107086Z", "completed_at": "2023-09-20T12:50:19.107086Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.020087718963623047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.103077Z", "completed_at": "2023-09-20T12:50:19.107086Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.112592Z", "completed_at": "2023-09-20T12:50:19.112592Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.020087718963623047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.107086Z", "completed_at": "2023-09-20T12:50:19.107086Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.113100Z", "completed_at": "2023-09-20T12:50:19.113100Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.020087718963623047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.107086Z", "completed_at": "2023-09-20T12:50:19.107086Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.114110Z", "completed_at": "2023-09-20T12:50:19.114110Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.020087718963623047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.122620Z", "completed_at": "2023-09-20T12:50:19.123141Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.123141Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.019133329391479492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.123141Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.123141Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.020084619522094727, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.123141Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.132734Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.020084619522094727, "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-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.123141Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.132734Z", "completed_at": "2023-09-20T12:50:19.132734Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.020084619522094727, "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-20T12:50:19.123141Z", "completed_at": "2023-09-20T12:50:19.123141Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.133244Z", "completed_at": "2023-09-20T12:50:19.133244Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.020084619522094727, "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-20T12:50:19.138716Z", "completed_at": "2023-09-20T12:50:19.143270Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.143270Z", "completed_at": "2023-09-20T12:50:19.143270Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016899585723876953, "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-20T12:50:19.143270Z", "completed_at": "2023-09-20T12:50:19.143270Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.143270Z", "completed_at": "2023-09-20T12:50:19.143270Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.014398574829101562, "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-20T12:50:19.143270Z", "completed_at": "2023-09-20T12:50:19.143270Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.151094Z", "completed_at": "2023-09-20T12:50:19.151094Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015238285064697266, "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-20T12:50:19.143270Z", "completed_at": "2023-09-20T12:50:19.143270Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.151094Z", "completed_at": "2023-09-20T12:50:19.151094Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015238285064697266, "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-20T12:50:19.143270Z", "completed_at": "2023-09-20T12:50:19.143270Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.152605Z", "completed_at": "2023-09-20T12:50:19.152605Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015238285064697266, "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-20T12:50:19.153954Z", "completed_at": "2023-09-20T12:50:19.162502Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.163512Z", "completed_at": "2023-09-20T12:50:19.163512Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016045570373535156, "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-20T12:50:19.163512Z", "completed_at": "2023-09-20T12:50:19.163512Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.169999Z", "completed_at": "2023-09-20T12:50:19.169999Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01855182647705078, "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-20T12:50:19.163512Z", "completed_at": "2023-09-20T12:50:19.163512Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.169999Z", "completed_at": "2023-09-20T12:50:19.169999Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0195620059967041, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.163512Z", "completed_at": "2023-09-20T12:50:19.163512Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.169999Z", "completed_at": "2023-09-20T12:50:19.169999Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0195620059967041, "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-20T12:50:19.163512Z", "completed_at": "2023-09-20T12:50:19.163512Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.172506Z", "completed_at": "2023-09-20T12:50:19.172506Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.020533084869384766, "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-20T12:50:19.174487Z", "completed_at": "2023-09-20T12:50:19.174487Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.233449Z", "completed_at": "2023-09-20T12:50:19.233449Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05896186828613281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.174487Z", "completed_at": "2023-09-20T12:50:19.182497Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.233449Z", "completed_at": "2023-09-20T12:50:19.233449Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06815433502197266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.183508Z", "completed_at": "2023-09-20T12:50:19.183508Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.233449Z", "completed_at": "2023-09-20T12:50:19.233449Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0687406063079834, "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-20T12:50:19.183508Z", "completed_at": "2023-09-20T12:50:19.233449Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.233449Z", "completed_at": "2023-09-20T12:50:19.233449Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06992244720458984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.233449Z", "completed_at": "2023-09-20T12:50:19.233449Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.233449Z", "completed_at": "2023-09-20T12:50:19.233449Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06992244720458984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.251088Z", "completed_at": "2023-09-20T12:50:19.251088Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.008735895156860352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__calendar"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.018011093139648438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.018011093139648438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__code_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.019032001495361328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.253145Z", "completed_at": "2023-09-20T12:50:19.253145Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015035867691040039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.265463Z", "completed_at": "2023-09-20T12:50:19.265463Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.008013486862182617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.272468Z", "completed_at": "2023-09-20T12:50:19.273476Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016087770462036133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.017094135284423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017603397369384766, "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-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.273476Z", "completed_at": "2023-09-20T12:50:19.273476Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.018573522567749023, "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-20T12:50:19.284036Z", "completed_at": "2023-09-20T12:50:19.284036Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.297565Z", "completed_at": "2023-09-20T12:50:19.297565Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.013528823852539062, "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-20T12:50:19.284036Z", "completed_at": "2023-09-20T12:50:19.284036Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.297565Z", "completed_at": "2023-09-20T12:50:19.297565Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.013528823852539062, "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-20T12:50:19.284036Z", "completed_at": "2023-09-20T12:50:19.293055Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.297565Z", "completed_at": "2023-09-20T12:50:19.297565Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.013528823852539062, "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-20T12:50:19.293055Z", "completed_at": "2023-09-20T12:50:19.293055Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.297565Z", "completed_at": "2023-09-20T12:50:19.297565Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018533945083618164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__mdc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.293055Z", "completed_at": "2023-09-20T12:50:19.293055Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.297565Z", "completed_at": "2023-09-20T12:50:19.297565Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0190427303314209, "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-20T12:50:19.304028Z", "completed_at": "2023-09-20T12:50:19.304028Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.009021282196044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.304028Z", "completed_at": "2023-09-20T12:50:19.304028Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.009021282196044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.304028Z", "completed_at": "2023-09-20T12:50:19.312539Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.009021282196044922, "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-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.009021282196044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.313050Z", "completed_at": "2023-09-20T12:50:19.313050Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.009021282196044922, "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-20T12:50:19.324340Z", "completed_at": "2023-09-20T12:50:19.324340Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.333396Z", "completed_at": "2023-09-20T12:50:19.333396Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.009950399398803711, "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-20T12:50:19.328861Z", "completed_at": "2023-09-20T12:50:19.328861Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.333396Z", "completed_at": "2023-09-20T12:50:19.333396Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.009055852890014648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__provider"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.328861Z", "completed_at": "2023-09-20T12:50:19.332373Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.333396Z", "completed_at": "2023-09-20T12:50:19.333396Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.009055852890014648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.332373Z", "completed_at": "2023-09-20T12:50:19.333396Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.333396Z", "completed_at": "2023-09-20T12:50:19.333396Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.009055852890014648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.333396Z", "completed_at": "2023-09-20T12:50:19.333396Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.333396Z", "completed_at": "2023-09-20T12:50:19.333396Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.009055852890014648, "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-20T12:50:19.344936Z", "completed_at": "2023-09-20T12:50:19.383315Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.384450Z", "completed_at": "2023-09-20T12:50:19.384450Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04136466979980469, "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-20T12:50:19.364386Z", "completed_at": "2023-09-20T12:50:19.384450Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.384450Z", "completed_at": "2023-09-20T12:50:19.384450Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04853057861328125, "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-20T12:50:19.373518Z", "completed_at": "2023-09-20T12:50:19.384450Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.384450Z", "completed_at": "2023-09-20T12:50:19.384450Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04854726791381836, "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-20T12:50:19.393483Z", "completed_at": "2023-09-20T12:50:19.414121Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.434254Z", "completed_at": "2023-09-20T12:50:19.434254Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0498049259185791, "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-20T12:50:19.403243Z", "completed_at": "2023-09-20T12:50:19.414121Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.434254Z", "completed_at": "2023-09-20T12:50:19.434254Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05582785606384277, "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-20T12:50:19.408153Z", "completed_at": "2023-09-20T12:50:19.434254Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.440277Z", "completed_at": "2023-09-20T12:50:19.440277Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.048810482025146484, "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-20T12:50:19.414121Z", "completed_at": "2023-09-20T12:50:19.434254Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.442294Z", "completed_at": "2023-09-20T12:50:19.442294Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03514885902404785, "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-20T12:50:19.424150Z", "completed_at": "2023-09-20T12:50:19.434254Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.443302Z", "completed_at": "2023-09-20T12:50:19.443302Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03514885902404785, "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-20T12:50:19.443302Z", "completed_at": "2023-09-20T12:50:19.463372Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.494405Z", "completed_at": "2023-09-20T12:50:19.494405Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05110335350036621, "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-20T12:50:19.456353Z", "completed_at": "2023-09-20T12:50:19.472681Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.494405Z", "completed_at": "2023-09-20T12:50:19.494405Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05110335350036621, "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-20T12:50:19.463372Z", "completed_at": "2023-09-20T12:50:19.494405Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.503422Z", "completed_at": "2023-09-20T12:50:19.503422Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.048670291900634766, "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-20T12:50:19.474336Z", "completed_at": "2023-09-20T12:50:19.494405Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.504431Z", "completed_at": "2023-09-20T12:50:19.504431Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.048670291900634766, "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-20T12:50:19.513963Z", "completed_at": "2023-09-20T12:50:19.523372Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.534666Z", "completed_at": "2023-09-20T12:50:19.534666Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03415656089782715, "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-20T12:50:19.523372Z", "completed_at": "2023-09-20T12:50:19.534666Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.539180Z", "completed_at": "2023-09-20T12:50:19.539180Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05024218559265137, "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-20T12:50:19.523372Z", "completed_at": "2023-09-20T12:50:19.534666Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.555098Z", "completed_at": "2023-09-20T12:50:19.555098Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.042807817459106445, "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-20T12:50:19.539180Z", "completed_at": "2023-09-20T12:50:19.564205Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.572231Z", "completed_at": "2023-09-20T12:50:19.572231Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0425870418548584, "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-20T12:50:19.562611Z", "completed_at": "2023-09-20T12:50:19.564205Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.577253Z", "completed_at": "2023-09-20T12:50:19.577253Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0526881217956543, "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-20T12:50:19.572231Z", "completed_at": "2023-09-20T12:50:19.587354Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.593376Z", "completed_at": "2023-09-20T12:50:19.593376Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029170513153076172, "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-20T12:50:19.577253Z", "completed_at": "2023-09-20T12:50:19.587354Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.593376Z", "completed_at": "2023-09-20T12:50:19.593376Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.029170513153076172, "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-20T12:50:19.584332Z", "completed_at": "2023-09-20T12:50:19.592366Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.593376Z", "completed_at": "2023-09-20T12:50:19.593376Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03282046318054199, "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-20T12:50:19.593376Z", "completed_at": "2023-09-20T12:50:19.604045Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.613066Z", "completed_at": "2023-09-20T12:50:19.613066Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03191113471984863, "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-20T12:50:19.613066Z", "completed_at": "2023-09-20T12:50:19.634398Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.644379Z", "completed_at": "2023-09-20T12:50:19.644379Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.048403263092041016, "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-20T12:50:19.624277Z", "completed_at": "2023-09-20T12:50:19.634398Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.644379Z", "completed_at": "2023-09-20T12:50:19.644379Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04941225051879883, "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-20T12:50:19.634398Z", "completed_at": "2023-09-20T12:50:19.651415Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.662467Z", "completed_at": "2023-09-20T12:50:19.662467Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029970169067382812, "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-20T12:50:19.644379Z", "completed_at": "2023-09-20T12:50:19.653457Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.664368Z", "completed_at": "2023-09-20T12:50:19.664368Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03197932243347168, "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-20T12:50:19.653457Z", "completed_at": "2023-09-20T12:50:19.663478Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.673439Z", "completed_at": "2023-09-20T12:50:19.673439Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029059410095214844, "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-20T12:50:19.666377Z", "completed_at": "2023-09-20T12:50:19.673439Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.684066Z", "completed_at": "2023-09-20T12:50:19.684066Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02965068817138672, "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-20T12:50:19.682556Z", "completed_at": "2023-09-20T12:50:19.693128Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.698259Z", "completed_at": "2023-09-20T12:50:19.698259Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.030766010284423828, "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-20T12:50:19.684066Z", "completed_at": "2023-09-20T12:50:19.693128Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.704205Z", "completed_at": "2023-09-20T12:50:19.704205Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.030766010284423828, "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-20T12:50:19.693128Z", "completed_at": "2023-09-20T12:50:19.704205Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.714286Z", "completed_at": "2023-09-20T12:50:19.714286Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.030219554901123047, "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-20T12:50:19.712229Z", "completed_at": "2023-09-20T12:50:19.714286Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.732372Z", "completed_at": "2023-09-20T12:50:19.732372Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031999826431274414, "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-20T12:50:19.714286Z", "completed_at": "2023-09-20T12:50:19.732372Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.752376Z", "completed_at": "2023-09-20T12:50:19.752376Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.040048837661743164, "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-20T12:50:19.733387Z", "completed_at": "2023-09-20T12:50:19.751343Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.754335Z", "completed_at": "2023-09-20T12:50:19.754335Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.040048837661743164, "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-20T12:50:19.734270Z", "completed_at": "2023-09-20T12:50:19.752376Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.754335Z", "completed_at": "2023-09-20T12:50:19.754335Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03301048278808594, "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-20T12:50:19.742295Z", "completed_at": "2023-09-20T12:50:19.754335Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.762346Z", "completed_at": "2023-09-20T12:50:19.762346Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03301048278808594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.754335Z", "completed_at": "2023-09-20T12:50:19.763375Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.763375Z", "completed_at": "2023-09-20T12:50:19.763375Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.020834684371948242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.763375Z", "completed_at": "2023-09-20T12:50:19.774220Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.803247Z", "completed_at": "2023-09-20T12:50:19.803247Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04090166091918945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.772302Z", "completed_at": "2023-09-20T12:50:19.783305Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.803247Z", "completed_at": "2023-09-20T12:50:19.803247Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04612135887145996, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.774220Z", "completed_at": "2023-09-20T12:50:19.803247Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.809496Z", "completed_at": "2023-09-20T12:50:19.809496Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.09987831115722656, "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-20T12:50:19.783305Z", "completed_at": "2023-09-20T12:50:19.803247Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.863253Z", "completed_at": "2023-09-20T12:50:19.863253Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.09987831115722656, "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-20T12:50:19.809496Z", "completed_at": "2023-09-20T12:50:19.863253Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.873072Z", "completed_at": "2023-09-20T12:50:19.873072Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.07897210121154785, "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-20T12:50:19.863253Z", "completed_at": "2023-09-20T12:50:19.873072Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.893395Z", "completed_at": "2023-09-20T12:50:19.893395Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03014230728149414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.873072Z", "completed_at": "2023-09-20T12:50:19.893395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.893395Z", "completed_at": "2023-09-20T12:50:19.893395Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04142045974731445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.883229Z", "completed_at": "2023-09-20T12:50:19.893395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.893395Z", "completed_at": "2023-09-20T12:50:19.893395Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0316009521484375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:19.884177Z", "completed_at": "2023-09-20T12:50:19.893395Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.904673Z", "completed_at": "2023-09-20T12:50:19.904673Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0316009521484375, "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-20T12:50:19.893395Z", "completed_at": "2023-09-20T12:50:19.904673Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.924395Z", "completed_at": "2023-09-20T12:50:19.924395Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.040123939514160156, "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-20T12:50:19.904673Z", "completed_at": "2023-09-20T12:50:19.935618Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.944455Z", "completed_at": "2023-09-20T12:50:19.944455Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03978157043457031, "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-20T12:50:19.924395Z", "completed_at": "2023-09-20T12:50:19.944455Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.944455Z", "completed_at": "2023-09-20T12:50:19.944455Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.048375844955444336, "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-20T12:50:19.933519Z", "completed_at": "2023-09-20T12:50:19.944455Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.944455Z", "completed_at": "2023-09-20T12:50:19.944455Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028653860092163086, "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-20T12:50:19.935618Z", "completed_at": "2023-09-20T12:50:19.944455Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.953049Z", "completed_at": "2023-09-20T12:50:19.953049Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.028653860092163086, "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-20T12:50:19.944455Z", "completed_at": "2023-09-20T12:50:19.953049Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:19.953049Z", "completed_at": "2023-09-20T12:50:19.953049Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0540013313293457, "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-20T12:50:19.953049Z", "completed_at": "2023-09-20T12:50:20.004193Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.014251Z", "completed_at": "2023-09-20T12:50:20.014251Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06120133399963379, "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-20T12:50:19.967208Z", "completed_at": "2023-09-20T12:50:20.004193Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.014251Z", "completed_at": "2023-09-20T12:50:20.014251Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06120133399963379, "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-20T12:50:19.998456Z", "completed_at": "2023-09-20T12:50:20.013240Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.014251Z", "completed_at": "2023-09-20T12:50:20.014251Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07137584686279297, "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-20T12:50:20.004193Z", "completed_at": "2023-09-20T12:50:20.013240Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.014251Z", "completed_at": "2023-09-20T12:50:20.014251Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07137584686279297, "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-20T12:50:20.014251Z", "completed_at": "2023-09-20T12:50:20.024425Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.033229Z", "completed_at": "2023-09-20T12:50:20.033229Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.033193111419677734, "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-20T12:50:20.029934Z", "completed_at": "2023-09-20T12:50:20.047444Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.054001Z", "completed_at": "2023-09-20T12:50:20.054001Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029575824737548828, "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-20T12:50:20.033229Z", "completed_at": "2023-09-20T12:50:20.053037Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.054001Z", "completed_at": "2023-09-20T12:50:20.054001Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.029575824737548828, "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-20T12:50:20.042421Z", "completed_at": "2023-09-20T12:50:20.054001Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.054001Z", "completed_at": "2023-09-20T12:50:20.054001Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03859424591064453, "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-20T12:50:20.047444Z", "completed_at": "2023-09-20T12:50:20.054001Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.063019Z", "completed_at": "2023-09-20T12:50:20.063019Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03308558464050293, "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-20T12:50:20.054001Z", "completed_at": "2023-09-20T12:50:20.063019Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.074110Z", "completed_at": "2023-09-20T12:50:20.074110Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.025133848190307617, "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-20T12:50:20.063019Z", "completed_at": "2023-09-20T12:50:20.083197Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.094162Z", "completed_at": "2023-09-20T12:50:20.094162Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03215336799621582, "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-20T12:50:20.074110Z", "completed_at": "2023-09-20T12:50:20.083197Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.095173Z", "completed_at": "2023-09-20T12:50:20.095173Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03915905952453613, "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-20T12:50:20.079135Z", "completed_at": "2023-09-20T12:50:20.092584Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.095173Z", "completed_at": "2023-09-20T12:50:20.095173Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04016685485839844, "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-20T12:50:20.083197Z", "completed_at": "2023-09-20T12:50:20.093092Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.095173Z", "completed_at": "2023-09-20T12:50:20.095173Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04016685485839844, "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-20T12:50:20.095173Z", "completed_at": "2023-09-20T12:50:20.103186Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.103186Z", "completed_at": "2023-09-20T12:50:20.103186Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.020894289016723633, "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-20T12:50:20.103186Z", "completed_at": "2023-09-20T12:50:20.123503Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.132457Z", "completed_at": "2023-09-20T12:50:20.132457Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03117060661315918, "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-20T12:50:20.113986Z", "completed_at": "2023-09-20T12:50:20.126951Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.133466Z", "completed_at": "2023-09-20T12:50:20.133466Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03117060661315918, "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-20T12:50:20.113986Z", "completed_at": "2023-09-20T12:50:20.126951Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.134357Z", "completed_at": "2023-09-20T12:50:20.134357Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03117060661315918, "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-20T12:50:20.123503Z", "completed_at": "2023-09-20T12:50:20.126951Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.134357Z", "completed_at": "2023-09-20T12:50:20.134357Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03117060661315918, "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-20T12:50:20.134357Z", "completed_at": "2023-09-20T12:50:20.134357Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.143393Z", "completed_at": "2023-09-20T12:50:20.143393Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02619028091430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.143393Z", "completed_at": "2023-09-20T12:50:20.159816Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.163366Z", "completed_at": "2023-09-20T12:50:20.163366Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029009103775024414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.143393Z", "completed_at": "2023-09-20T12:50:20.163366Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.163366Z", "completed_at": "2023-09-20T12:50:20.163366Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.021001100540161133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.154172Z", "completed_at": "2023-09-20T12:50:20.163366Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.163366Z", "completed_at": "2023-09-20T12:50:20.163366Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02964186668395996, "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-20T12:50:20.159816Z", "completed_at": "2023-09-20T12:50:20.163366Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.172513Z", "completed_at": "2023-09-20T12:50:20.172513Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.030599117279052734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.163366Z", "completed_at": "2023-09-20T12:50:20.173992Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.173992Z", "completed_at": "2023-09-20T12:50:20.173992Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026676416397094727, "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-20T12:50:20.173992Z", "completed_at": "2023-09-20T12:50:20.193057Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.193057Z", "completed_at": "2023-09-20T12:50:20.193057Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.028240680694580078, "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-20T12:50:20.182518Z", "completed_at": "2023-09-20T12:50:20.193057Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.193057Z", "completed_at": "2023-09-20T12:50:20.193057Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03169751167297363, "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-20T12:50:20.190042Z", "completed_at": "2023-09-20T12:50:20.193057Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.202233Z", "completed_at": "2023-09-20T12:50:20.202233Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03169751167297363, "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-20T12:50:20.193057Z", "completed_at": "2023-09-20T12:50:20.193057Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.205690Z", "completed_at": "2023-09-20T12:50:20.205690Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03169751167297363, "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-20T12:50:20.224064Z", "completed_at": "2023-09-20T12:50:20.238716Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.244316Z", "completed_at": "2023-09-20T12:50:20.244316Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031085968017578125, "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-20T12:50:20.232576Z", "completed_at": "2023-09-20T12:50:20.243233Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.244316Z", "completed_at": "2023-09-20T12:50:20.244316Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030797958374023438, "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-20T12:50:20.244316Z", "completed_at": "2023-09-20T12:50:20.264444Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.273474Z", "completed_at": "2023-09-20T12:50:20.273474Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029157400131225586, "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-20T12:50:20.253415Z", "completed_at": "2023-09-20T12:50:20.264444Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.273474Z", "completed_at": "2023-09-20T12:50:20.273474Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04086136817932129, "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-20T12:50:20.253415Z", "completed_at": "2023-09-20T12:50:20.264444Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.273474Z", "completed_at": "2023-09-20T12:50:20.273474Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04086136817932129, "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-20T12:50:20.269459Z", "completed_at": "2023-09-20T12:50:20.273474Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.285178Z", "completed_at": "2023-09-20T12:50:20.285178Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.020734310150146484, "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-20T12:50:20.324236Z", "completed_at": "2023-09-20T12:50:20.333295Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.351931Z", "completed_at": "2023-09-20T12:50:20.351931Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03617048263549805, "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-20T12:50:20.332258Z", "completed_at": "2023-09-20T12:50:20.333295Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.352482Z", "completed_at": "2023-09-20T12:50:20.352482Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03617048263549805, "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-20T12:50:20.333295Z", "completed_at": "2023-09-20T12:50:20.352482Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.353490Z", "completed_at": "2023-09-20T12:50:20.353490Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.032065629959106445, "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-20T12:50:20.344397Z", "completed_at": "2023-09-20T12:50:20.353490Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.365360Z", "completed_at": "2023-09-20T12:50:20.365360Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.032065629959106445, "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-20T12:50:20.353490Z", "completed_at": "2023-09-20T12:50:20.365360Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.374480Z", "completed_at": "2023-09-20T12:50:20.374480Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029006242752075195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.365360Z", "completed_at": "2023-09-20T12:50:20.381490Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.393115Z", "completed_at": "2023-09-20T12:50:20.393115Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.028787851333618164, "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-20T12:50:20.374480Z", "completed_at": "2023-09-20T12:50:20.382497Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.394148Z", "completed_at": "2023-09-20T12:50:20.394148Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028787851333618164, "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-20T12:50:20.383517Z", "completed_at": "2023-09-20T12:50:20.393115Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.397157Z", "completed_at": "2023-09-20T12:50:20.397157Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02869391441345215, "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-20T12:50:20.387558Z", "completed_at": "2023-09-20T12:50:20.394148Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.402163Z", "completed_at": "2023-09-20T12:50:20.402163Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02869391441345215, "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-20T12:50:20.397157Z", "completed_at": "2023-09-20T12:50:20.403173Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.414354Z", "completed_at": "2023-09-20T12:50:20.414354Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.020206451416015625, "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-20T12:50:20.403173Z", "completed_at": "2023-09-20T12:50:20.414354Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.428403Z", "completed_at": "2023-09-20T12:50:20.428403Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.030247211456298828, "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-20T12:50:20.414354Z", "completed_at": "2023-09-20T12:50:20.414354Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.432410Z", "completed_at": "2023-09-20T12:50:20.432410Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03111553192138672, "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-20T12:50:20.422374Z", "completed_at": "2023-09-20T12:50:20.428403Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.434289Z", "completed_at": "2023-09-20T12:50:20.434289Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01993417739868164, "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-20T12:50:20.423383Z", "completed_at": "2023-09-20T12:50:20.432410Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.434289Z", "completed_at": "2023-09-20T12:50:20.434289Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.027942895889282227, "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-20T12:50:20.444317Z", "completed_at": "2023-09-20T12:50:20.453370Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.473481Z", "completed_at": "2023-09-20T12:50:20.473481Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.041785478591918945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.444317Z", "completed_at": "2023-09-20T12:50:20.453370Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.474565Z", "completed_at": "2023-09-20T12:50:20.474565Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04832935333251953, "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-20T12:50:20.454295Z", "completed_at": "2023-09-20T12:50:20.473481Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.483128Z", "completed_at": "2023-09-20T12:50:20.483128Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03881072998046875, "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-20T12:50:20.454295Z", "completed_at": "2023-09-20T12:50:20.474565Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.483128Z", "completed_at": "2023-09-20T12:50:20.483128Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03130459785461426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_profiling__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.474565Z", "completed_at": "2023-09-20T12:50:20.483128Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.483128Z", "completed_at": "2023-09-20T12:50:20.483128Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04028916358947754, "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-20T12:50:20.483128Z", "completed_at": "2023-09-20T12:50:20.494585Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.513353Z", "completed_at": "2023-09-20T12:50:20.513353Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.030225038528442383, "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-20T12:50:20.494585Z", "completed_at": "2023-09-20T12:50:20.502605Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.513353Z", "completed_at": "2023-09-20T12:50:20.513353Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.030225038528442383, "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-20T12:50:20.503114Z", "completed_at": "2023-09-20T12:50:20.513353Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.513353Z", "completed_at": "2023-09-20T12:50:20.513353Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.028925657272338867, "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-20T12:50:20.508331Z", "completed_at": "2023-09-20T12:50:20.513353Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.522488Z", "completed_at": "2023-09-20T12:50:20.522488Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029920101165771484, "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-20T12:50:20.513353Z", "completed_at": "2023-09-20T12:50:20.513353Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.524505Z", "completed_at": "2023-09-20T12:50:20.524505Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029920101165771484, "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-20T12:50:20.524505Z", "completed_at": "2023-09-20T12:50:20.564512Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.574161Z", "completed_at": "2023-09-20T12:50:20.574161Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05167269706726074, "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-20T12:50:20.564512Z", "completed_at": "2023-09-20T12:50:20.574161Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.574161Z", "completed_at": "2023-09-20T12:50:20.574161Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04965615272521973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.572521Z", "completed_at": "2023-09-20T12:50:20.574161Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.574161Z", "completed_at": "2023-09-20T12:50:20.574161Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.009649038314819336, "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-20T12:50:20.584225Z", "completed_at": "2023-09-20T12:50:20.642453Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.643478Z", "completed_at": "2023-09-20T12:50:20.643478Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05925297737121582, "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-20T12:50:20.644569Z", "completed_at": "2023-09-20T12:50:20.654503Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.654503Z", "completed_at": "2023-09-20T12:50:20.654503Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01794600486755371, "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-20T12:50:20.654503Z", "completed_at": "2023-09-20T12:50:20.654503Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.654503Z", "completed_at": "2023-09-20T12:50:20.654503Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018467187881469727, "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-20T12:50:20.663969Z", "completed_at": "2023-09-20T12:50:20.663969Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.663969Z", "completed_at": "2023-09-20T12:50:20.663969Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0, "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-20T12:50:20.670479Z", "completed_at": "2023-09-20T12:50:20.687155Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.687155Z", "completed_at": "2023-09-20T12:50:20.687155Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016675472259521484, "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-20T12:50:20.687155Z", "completed_at": "2023-09-20T12:50:20.694304Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.694304Z", "completed_at": "2023-09-20T12:50:20.694304Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.007149457931518555, "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-20T12:50:20.694304Z", "completed_at": "2023-09-20T12:50:20.733433Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.743183Z", "completed_at": "2023-09-20T12:50:20.743183Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.048879384994506836, "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-20T12:50:20.703357Z", "completed_at": "2023-09-20T12:50:20.743183Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.743183Z", "completed_at": "2023-09-20T12:50:20.743183Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05504441261291504, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.723101Z", "completed_at": "2023-09-20T12:50:20.743183Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.749348Z", "completed_at": "2023-09-20T12:50:20.749348Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04599118232727051, "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-20T12:50:20.753399Z", "completed_at": "2023-09-20T12:50:20.814686Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.833111Z", "completed_at": "2023-09-20T12:50:20.833111Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09508180618286133, "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-20T12:50:20.814686Z", "completed_at": "2023-09-20T12:50:20.833111Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.845440Z", "completed_at": "2023-09-20T12:50:20.845440Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0920417308807373, "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-20T12:50:20.823210Z", "completed_at": "2023-09-20T12:50:20.842266Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.845440Z", "completed_at": "2023-09-20T12:50:20.845440Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03192138671875, "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-20T12:50:20.823210Z", "completed_at": "2023-09-20T12:50:20.842266Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.845440Z", "completed_at": "2023-09-20T12:50:20.845440Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03294730186462402, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.833111Z", "completed_at": "2023-09-20T12:50:20.843274Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.845440Z", "completed_at": "2023-09-20T12:50:20.845440Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03192138671875, "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-20T12:50:20.852458Z", "completed_at": "2023-09-20T12:50:20.864558Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.892613Z", "completed_at": "2023-09-20T12:50:20.892613Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04770350456237793, "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-20T12:50:20.864558Z", "completed_at": "2023-09-20T12:50:20.884604Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.893144Z", "completed_at": "2023-09-20T12:50:20.893144Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04119873046875, "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-20T12:50:20.877335Z", "completed_at": "2023-09-20T12:50:20.884604Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.893144Z", "completed_at": "2023-09-20T12:50:20.893144Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.028586387634277344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.904053Z", "completed_at": "2023-09-20T12:50:20.932330Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.940254Z", "completed_at": "2023-09-20T12:50:20.940254Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.049115657806396484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.912593Z", "completed_at": "2023-09-20T12:50:20.933407Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.940254Z", "completed_at": "2023-09-20T12:50:20.940254Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05013561248779297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.913115Z", "completed_at": "2023-09-20T12:50:20.933407Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.942260Z", "completed_at": "2023-09-20T12:50:20.942260Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05109119415283203, "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-20T12:50:20.932330Z", "completed_at": "2023-09-20T12:50:20.940254Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.943280Z", "completed_at": "2023-09-20T12:50:20.943280Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.041632890701293945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.962272Z", "completed_at": "2023-09-20T12:50:20.964593Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:20.973124Z", "completed_at": "2023-09-20T12:50:20.973124Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.028888702392578125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__stg_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:20.984286Z", "completed_at": "2023-09-20T12:50:20.997383Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.004413Z", "completed_at": "2023-09-20T12:50:21.004413Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031289100646972656, "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-20T12:50:20.988298Z", "completed_at": "2023-09-20T12:50:21.004413Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.004413Z", "completed_at": "2023-09-20T12:50:21.004413Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03929591178894043, "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-20T12:50:20.997383Z", "completed_at": "2023-09-20T12:50:21.004413Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.020430Z", "completed_at": "2023-09-20T12:50:21.020430Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03514742851257324, "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-20T12:50:21.012420Z", "completed_at": "2023-09-20T12:50:21.023445Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.032553Z", "completed_at": "2023-09-20T12:50:21.032553Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03210783004760742, "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-20T12:50:21.043041Z", "completed_at": "2023-09-20T12:50:21.054385Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.114286Z", "completed_at": "2023-09-20T12:50:21.114286Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07776522636413574, "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-20T12:50:21.054385Z", "completed_at": "2023-09-20T12:50:21.114286Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.127523Z", "completed_at": "2023-09-20T12:50:21.127523Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09000372886657715, "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-20T12:50:21.083089Z", "completed_at": "2023-09-20T12:50:21.114286Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.132534Z", "completed_at": "2023-09-20T12:50:21.132534Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07973670959472656, "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-20T12:50:21.103354Z", "completed_at": "2023-09-20T12:50:21.114286Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.134122Z", "completed_at": "2023-09-20T12:50:21.134122Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07973670959472656, "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-20T12:50:21.118309Z", "completed_at": "2023-09-20T12:50:21.133044Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.134122Z", "completed_at": "2023-09-20T12:50:21.134122Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03978610038757324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_primary_dx_per_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.134122Z", "completed_at": "2023-09-20T12:50:21.153334Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.197593Z", "completed_at": "2023-09-20T12:50:21.197593Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06347131729125977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.143140Z", "completed_at": "2023-09-20T12:50:21.165864Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.197593Z", "completed_at": "2023-09-20T12:50:21.197593Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09489846229553223, "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-20T12:50:21.162445Z", "completed_at": "2023-09-20T12:50:21.197593Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.229020Z", "completed_at": "2023-09-20T12:50:21.229020Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.08992528915405273, "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-20T12:50:21.165864Z", "completed_at": "2023-09-20T12:50:21.197593Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.232526Z", "completed_at": "2023-09-20T12:50:21.232526Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08992528915405273, "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-20T12:50:21.202655Z", "completed_at": "2023-09-20T12:50:21.229020Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.276276Z", "completed_at": "2023-09-20T12:50:21.276276Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1104116439819336, "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-20T12:50:21.233065Z", "completed_at": "2023-09-20T12:50:21.276276Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.293293Z", "completed_at": "2023-09-20T12:50:21.293293Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06427288055419922, "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-20T12:50:21.276276Z", "completed_at": "2023-09-20T12:50:21.284645Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.293293Z", "completed_at": "2023-09-20T12:50:21.293293Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08469986915588379, "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-20T12:50:21.284645Z", "completed_at": "2023-09-20T12:50:21.293293Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.317765Z", "completed_at": "2023-09-20T12:50:21.317765Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04704737663269043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.293293Z", "completed_at": "2023-09-20T12:50:21.293293Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.322315Z", "completed_at": "2023-09-20T12:50:21.322315Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03969168663024902, "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-20T12:50:21.324337Z", "completed_at": "2023-09-20T12:50:21.334292Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.342436Z", "completed_at": "2023-09-20T12:50:21.342436Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.025695085525512695, "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-20T12:50:21.324337Z", "completed_at": "2023-09-20T12:50:21.334292Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.343461Z", "completed_at": "2023-09-20T12:50:21.343461Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.019123554229736328, "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-20T12:50:21.334292Z", "completed_at": "2023-09-20T12:50:21.343461Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.343461Z", "completed_at": "2023-09-20T12:50:21.343461Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.019123554229736328, "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-20T12:50:21.334292Z", "completed_at": "2023-09-20T12:50:21.343461Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.343461Z", "completed_at": "2023-09-20T12:50:21.343461Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.009168863296508789, "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-20T12:50:21.343461Z", "completed_at": "2023-09-20T12:50:21.362620Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.363130Z", "completed_at": "2023-09-20T12:50:21.363130Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029791831970214844, "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-20T12:50:21.356110Z", "completed_at": "2023-09-20T12:50:21.363130Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.374376Z", "completed_at": "2023-09-20T12:50:21.374376Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03091573715209961, "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-20T12:50:21.363130Z", "completed_at": "2023-09-20T12:50:21.374376Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.374376Z", "completed_at": "2023-09-20T12:50:21.374376Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.018265962600708008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_merge_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.363130Z", "completed_at": "2023-09-20T12:50:21.374376Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.374376Z", "completed_at": "2023-09-20T12:50:21.374376Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.018265962600708008, "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-20T12:50:21.388314Z", "completed_at": "2023-09-20T12:50:21.392319Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.404217Z", "completed_at": "2023-09-20T12:50:21.404217Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03060293197631836, "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-20T12:50:21.394176Z", "completed_at": "2023-09-20T12:50:21.404979Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.414003Z", "completed_at": "2023-09-20T12:50:21.414003Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025688886642456055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.414003Z", "completed_at": "2023-09-20T12:50:21.435925Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.454345Z", "completed_at": "2023-09-20T12:50:21.454345Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04034161567687988, "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-20T12:50:21.422534Z", "completed_at": "2023-09-20T12:50:21.454345Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.454345Z", "completed_at": "2023-09-20T12:50:21.454345Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04336953163146973, "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-20T12:50:21.454345Z", "completed_at": "2023-09-20T12:50:21.463393Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.467685Z", "completed_at": "2023-09-20T12:50:21.467685Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017846107482910156, "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-20T12:50:21.467685Z", "completed_at": "2023-09-20T12:50:21.473200Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.473200Z", "completed_at": "2023-09-20T12:50:21.473200Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.009807348251342773, "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-20T12:50:21.473200Z", "completed_at": "2023-09-20T12:50:21.473200Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.565159Z", "completed_at": "2023-09-20T12:50:21.565159Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09195828437805176, "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-20T12:50:21.473200Z", "completed_at": "2023-09-20T12:50:21.573205Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.644471Z", "completed_at": "2023-09-20T12:50:21.644471Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.17127060890197754, "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-20T12:50:21.573205Z", "completed_at": "2023-09-20T12:50:21.676348Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.677351Z", "completed_at": "2023-09-20T12:50:21.677351Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.10467672348022461, "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-20T12:50:21.644471Z", "completed_at": "2023-09-20T12:50:21.687645Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.692729Z", "completed_at": "2023-09-20T12:50:21.692729Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0487828254699707, "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-20T12:50:21.677351Z", "completed_at": "2023-09-20T12:50:21.724554Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.724554Z", "completed_at": "2023-09-20T12:50:21.724554Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.055727243423461914, "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-20T12:50:21.694292Z", "completed_at": "2023-09-20T12:50:21.724554Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.734107Z", "completed_at": "2023-09-20T12:50:21.734107Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.039813995361328125, "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-20T12:50:21.734107Z", "completed_at": "2023-09-20T12:50:21.804481Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.804481Z", "completed_at": "2023-09-20T12:50:21.804481Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.07840609550476074, "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-20T12:50:21.756664Z", "completed_at": "2023-09-20T12:50:21.804481Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.813031Z", "completed_at": "2023-09-20T12:50:21.813031Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07892465591430664, "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-20T12:50:21.813031Z", "completed_at": "2023-09-20T12:50:21.823164Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.824023Z", "completed_at": "2023-09-20T12:50:21.824023Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.010991573333740234, "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-20T12:50:21.820149Z", "completed_at": "2023-09-20T12:50:21.824023Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.824023Z", "completed_at": "2023-09-20T12:50:21.824023Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.010991573333740234, "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-20T12:50:21.824023Z", "completed_at": "2023-09-20T12:50:21.836068Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.836068Z", "completed_at": "2023-09-20T12:50:21.836068Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.012044906616210938, "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-20T12:50:21.833042Z", "completed_at": "2023-09-20T12:50:21.836068Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.843109Z", "completed_at": "2023-09-20T12:50:21.843109Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.011005163192749023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_class"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.844047Z", "completed_at": "2023-09-20T12:50:21.844047Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.852565Z", "completed_at": "2023-09-20T12:50:21.852565Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.009964227676391602, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__unclassified_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.844047Z", "completed_at": "2023-09-20T12:50:21.852565Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.853596Z", "completed_at": "2023-09-20T12:50:21.853596Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.009549140930175781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__unclassified_rows"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.853596Z", "completed_at": "2023-09-20T12:50:21.864146Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.864146Z", "completed_at": "2023-09-20T12:50:21.864146Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01055002212524414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.853596Z", "completed_at": "2023-09-20T12:50:21.864146Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.864146Z", "completed_at": "2023-09-20T12:50:21.864146Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014566183090209961, "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-20T12:50:21.868162Z", "completed_at": "2023-09-20T12:50:21.873217Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.873217Z", "completed_at": "2023-09-20T12:50:21.873217Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0050547122955322266, "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-20T12:50:21.873217Z", "completed_at": "2023-09-20T12:50:21.873217Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.873217Z", "completed_at": "2023-09-20T12:50:21.873217Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0, "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-20T12:50:21.302381Z", "completed_at": "2023-09-20T12:50:21.733078Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.734107Z", "completed_at": "2023-09-20T12:50:21.734107Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.5906898975372314, "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-20T12:50:21.873217Z", "completed_at": "2023-09-20T12:50:21.884549Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.897601Z", "completed_at": "2023-09-20T12:50:21.897601Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.024384260177612305, "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-20T12:50:21.884549Z", "completed_at": "2023-09-20T12:50:21.897601Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.900107Z", "completed_at": "2023-09-20T12:50:21.900107Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01857280731201172, "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-20T12:50:21.892567Z", "completed_at": "2023-09-20T12:50:21.900107Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.902613Z", "completed_at": "2023-09-20T12:50:21.902613Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.019503355026245117, "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-20T12:50:21.904052Z", "completed_at": "2023-09-20T12:50:21.904052Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.924024Z", "completed_at": "2023-09-20T12:50:21.924024Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.023916244506835938, "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-20T12:50:21.913069Z", "completed_at": "2023-09-20T12:50:21.924024Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.924024Z", "completed_at": "2023-09-20T12:50:21.924024Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.019971609115600586, "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-20T12:50:21.916091Z", "completed_at": "2023-09-20T12:50:21.924024Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.924024Z", "completed_at": "2023-09-20T12:50:21.924024Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.019971609115600586, "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-20T12:50:21.924024Z", "completed_at": "2023-09-20T12:50:21.933069Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:21.964391Z", "completed_at": "2023-09-20T12:50:21.964391Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.12025189399719238, "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-20T12:50:21.933069Z", "completed_at": "2023-09-20T12:50:21.964391Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.044275Z", "completed_at": "2023-09-20T12:50:22.044275Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.1112067699432373, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_condition_with_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.953831Z", "completed_at": "2023-09-20T12:50:21.964391Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.044275Z", "completed_at": "2023-09-20T12:50:22.044275Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1192164421081543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_patient_list"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.054151Z", "completed_at": "2023-09-20T12:50:22.060159Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.074043Z", "completed_at": "2023-09-20T12:50:22.074043Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03238320350646973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__unclassified_conditions_ccs_description_with_covid.98c0a02ee5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.063175Z", "completed_at": "2023-09-20T12:50:22.076053Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.078031Z", "completed_at": "2023-09-20T12:50:22.078031Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0238802433013916, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.dbt_utils_accepted_range_ed_classification__unclassified_rows_condition_row_unclassified_percent__20.c49ee34e50"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.063175Z", "completed_at": "2023-09-20T12:50:22.076659Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.078031Z", "completed_at": "2023-09-20T12:50:22.078031Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.09008598327636719, "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-20T12:50:22.144236Z", "completed_at": "2023-09-20T12:50:22.153278Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.164260Z", "completed_at": "2023-09-20T12:50:22.164260Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08622956275939941, "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-20T12:50:22.153791Z", "completed_at": "2023-09-20T12:50:22.164260Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.164260Z", "completed_at": "2023-09-20T12:50:22.164260Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.020023822784423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.157307Z", "completed_at": "2023-09-20T12:50:22.164260Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.164260Z", "completed_at": "2023-09-20T12:50:22.164260Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.020011425018310547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:21.374376Z", "completed_at": "2023-09-20T12:50:22.044275Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.053804Z", "completed_at": "2023-09-20T12:50:22.053804Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.8189258575439453, "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-20T12:50:21.394176Z", "completed_at": "2023-09-20T12:50:22.044275Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.052285Z", "completed_at": "2023-09-20T12:50:22.052285Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.8138980865478516, "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-20T12:50:22.177320Z", "completed_at": "2023-09-20T12:50:22.193302Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.197318Z", "completed_at": "2023-09-20T12:50:22.197318Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02500462532043457, "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-20T12:50:22.184261Z", "completed_at": "2023-09-20T12:50:22.197318Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.202325Z", "completed_at": "2023-09-20T12:50:22.202325Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0269162654876709, "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-20T12:50:22.204236Z", "completed_at": "2023-09-20T12:50:22.213281Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.244033Z", "completed_at": "2023-09-20T12:50:22.244033Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05682682991027832, "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-20T12:50:22.205258Z", "completed_at": "2023-09-20T12:50:22.213281Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.254144Z", "completed_at": "2023-09-20T12:50:22.254144Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06535220146179199, "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-20T12:50:22.213281Z", "completed_at": "2023-09-20T12:50:22.254144Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.263257Z", "completed_at": "2023-09-20T12:50:22.263257Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05920743942260742, "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-20T12:50:22.244033Z", "completed_at": "2023-09-20T12:50:22.263257Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.264465Z", "completed_at": "2023-09-20T12:50:22.264465Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.055193185806274414, "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-20T12:50:22.268474Z", "completed_at": "2023-09-20T12:50:22.273044Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.273044Z", "completed_at": "2023-09-20T12:50:22.273044Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01994156837463379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__claim_categorization"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.273044Z", "completed_at": "2023-09-20T12:50:22.273044Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.284406Z", "completed_at": "2023-09-20T12:50:22.284406Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01994156837463379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.273044Z", "completed_at": "2023-09-20T12:50:22.282352Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.284406Z", "completed_at": "2023-09-20T12:50:22.284406Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.011911392211914062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__int_condition_with_claim_claim_id.4da25e12a1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.282352Z", "completed_at": "2023-09-20T12:50:22.284406Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.284406Z", "completed_at": "2023-09-20T12:50:22.284406Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02130746841430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__int_condition_with_claim_claim_id.83085e1bba"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.292432Z", "completed_at": "2023-09-20T12:50:22.307406Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.316394Z", "completed_at": "2023-09-20T12:50:22.316394Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.038117170333862305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.294351Z", "completed_at": "2023-09-20T12:50:22.314382Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.317011Z", "completed_at": "2023-09-20T12:50:22.317011Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03863024711608887, "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-20T12:50:22.307406Z", "completed_at": "2023-09-20T12:50:22.317011Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.323037Z", "completed_at": "2023-09-20T12:50:22.323037Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.028685569763183594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.317011Z", "completed_at": "2023-09-20T12:50:22.323037Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.323037Z", "completed_at": "2023-09-20T12:50:22.323037Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02688431739807129, "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-20T12:50:22.334290Z", "completed_at": "2023-09-20T12:50:22.334290Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.343317Z", "completed_at": "2023-09-20T12:50:22.343317Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.020280122756958008, "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-20T12:50:22.323037Z", "completed_at": "2023-09-20T12:50:22.334290Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.343317Z", "completed_at": "2023-09-20T12:50:22.343317Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.024950504302978516, "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-20T12:50:22.342307Z", "completed_at": "2023-09-20T12:50:22.343317Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.353502Z", "completed_at": "2023-09-20T12:50:22.353502Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.020165205001831055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_ccs_description"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.347987Z", "completed_at": "2023-09-20T12:50:22.352493Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.354456Z", "completed_at": "2023-09-20T12:50:22.354456Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.029190778732299805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_patient_race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.354456Z", "completed_at": "2023-09-20T12:50:22.363481Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.363481Z", "completed_at": "2023-09-20T12:50:22.363481Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.010988235473632812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_parent_organization"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.354456Z", "completed_at": "2023-09-20T12:50:22.363481Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.363481Z", "completed_at": "2023-09-20T12:50:22.363481Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.02005481719970703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_provider_practice_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.363481Z", "completed_at": "2023-09-20T12:50:22.363481Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.374067Z", "completed_at": "2023-09-20T12:50:22.374067Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.010586261749267578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_year"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.363481Z", "completed_at": "2023-09-20T12:50:22.374067Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.383152Z", "completed_at": "2023-09-20T12:50:22.383152Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01967144012451172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_by_year_month"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.380130Z", "completed_at": "2023-09-20T12:50:22.392391Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.395341Z", "completed_at": "2023-09-20T12:50:22.395341Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028280973434448242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.383152Z", "completed_at": "2023-09-20T12:50:22.394331Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.395341Z", "completed_at": "2023-09-20T12:50:22.395341Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03330111503601074, "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-20T12:50:22.395341Z", "completed_at": "2023-09-20T12:50:22.402348Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.407368Z", "completed_at": "2023-09-20T12:50:22.407368Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0199887752532959, "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-20T12:50:22.402348Z", "completed_at": "2023-09-20T12:50:22.407368Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.407368Z", "completed_at": "2023-09-20T12:50:22.407368Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01804947853088379, "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-20T12:50:22.413388Z", "completed_at": "2023-09-20T12:50:22.414301Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.422313Z", "completed_at": "2023-09-20T12:50:22.422313Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015954971313476562, "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-20T12:50:22.414301Z", "completed_at": "2023-09-20T12:50:22.423323Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.433036Z", "completed_at": "2023-09-20T12:50:22.433036Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.021661758422851562, "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-20T12:50:22.428021Z", "completed_at": "2023-09-20T12:50:22.433036Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.433036Z", "completed_at": "2023-09-20T12:50:22.433036Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.018735408782958984, "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-20T12:50:22.423323Z", "completed_at": "2023-09-20T12:50:22.433036Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.433036Z", "completed_at": "2023-09-20T12:50:22.433036Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.028155803680419922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-09-20T12:50:22.173281Z", "completed_at": "2023-09-20T12:50:22.714291Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.714291Z", "completed_at": "2023-09-20T12:50:22.714291Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.6204574108123779, "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-20T12:50:22.784718Z", "completed_at": "2023-09-20T12:50:22.793272Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.798483Z", "completed_at": "2023-09-20T12:50:22.798483Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.013765335083007812, "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-20T12:50:22.793272Z", "completed_at": "2023-09-20T12:50:22.793272Z"}, {"name": "execute", "started_at": "2023-09-20T12:50:22.798483Z", "completed_at": "2023-09-20T12:50:22.798483Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.013765335083007812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"}], "elapsed_time": 5.929265260696411, "args": {"populate_cache": true, "log_level": "info", "partial_parse": true, "which": "generate", "indirect_selection": "eager", "log_format_file": "debug", "profiles_dir": "C:\\Users\\thuxuan\\PycharmProjects", "enable_legacy_logger": false, "printer_width": 80, "use_colors": true, "vars": {}, "defer": false, "cache_selected_only": false, "exclude": [], "introspect": true, "send_anonymous_usage_stats": true, "use_colors_file": true, "quiet": false, "macro_debugging": false, "print": true, "write_json": true, "log_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate\\..\\logs", "warn_error_options": {"include": [], "exclude": []}, "select": [], "log_format": "default", "strict_mode": false, "project_dir": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "favor_state": false, "compile": true, "version_check": true, "log_level_file": "debug", "static_parser": true}} \ No newline at end of file diff --git a/models/claims_preprocessing/service_category/final/service_category__service_category_grouper.sql b/models/claims_preprocessing/service_category/final/service_category__service_category_grouper.sql index 9a3965129..9edae74ec 100644 --- a/models/claims_preprocessing/service_category/final/service_category__service_category_grouper.sql +++ b/models/claims_preprocessing/service_category/final/service_category__service_category_grouper.sql @@ -2,71 +2,111 @@ enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) ) }} +with service_category_1_mapping as( + select distinct + a.claim_id + , a.claim_line_number + , a.claim_type + , case + when service_category_2 = 'Acute Inpatient' then 'Inpatient' + when service_category_2 = 'Ambulance' then 'Ancillary' + when service_category_2 = 'Ambulatory Surgery' then 'Outpatient' + when service_category_2 = 'Dialysis' then 'Outpatient' + when service_category_2 = 'Durable Medical Equipment' then 'Ancillary' + when service_category_2 = 'Emergency Department' then 'Outpatient' + when service_category_2 = 'Home Health' then 'Outpatient' + when service_category_2 = 'Hospice' then 'Outpatient' + when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient' + when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient' + when service_category_2 = 'Lab' then 'Ancillary' + when service_category_2 = 'Office Visit' then 'Office Visit' + when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient' + when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient' + when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient' + when service_category_2 = 'Skilled Nursing' then 'Inpatient' + when service_category_2 = 'Urgent Care' then 'Outpatient' + when service_category_2 is null then 'Other' + end service_category_1 + , case + when service_category_2 is null then 'Other' + else service_category_2 + end service_category_2 + , '{{ var('tuva_last_run')}}' as tuva_last_run + from {{ ref('service_category__stg_medical_claim') }} a + left join {{ ref('service_category__combined_professional') }} b + on a.claim_id = b.claim_id + and a.claim_line_number = b.claim_line_number + where a.claim_type = 'professional' -select distinct - a.claim_id -, a.claim_line_number -, a.claim_type -, case - when service_category_2 = 'Acute Inpatient' then 'Inpatient' - when service_category_2 = 'Ambulance' then 'Ancillary' - when service_category_2 = 'Ambulatory Surgery' then 'Outpatient' - when service_category_2 = 'Dialysis' then 'Outpatient' - when service_category_2 = 'Durable Medical Equipment' then 'Ancillary' - when service_category_2 = 'Emergency Department' then 'Outpatient' - when service_category_2 = 'Home Health' then 'Outpatient' - when service_category_2 = 'Hospice' then 'Outpatient' - when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient' - when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient' - when service_category_2 = 'Lab' then 'Ancillary' - when service_category_2 = 'Office Visit' then 'Office Visit' - when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient' - when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient' - when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient' - when service_category_2 = 'Skilled Nursing' then 'Inpatient' - when service_category_2 = 'Urgent Care' then 'Outpatient' - when service_category_2 is null then 'Other' - end service_category_1 -, case - when service_category_2 is null then 'Other' - else service_category_2 - end service_category_2 -, '{{ var('tuva_last_run')}}' as tuva_last_run -from {{ ref('service_category__stg_medical_claim') }} a -left join {{ ref('service_category__combined_professional') }} b - on a.claim_id = b.claim_id - and a.claim_line_number = b.claim_line_number -where a.claim_type = 'professional' + union all -union all + select distinct + a.claim_id + , a.claim_line_number + , a.claim_type + , case + when service_category_2 = 'Acute Inpatient' then 'Inpatient' + when service_category_2 = 'Ambulatory Surgery' then 'Outpatient' + when service_category_2 = 'Dialysis' then 'Outpatient' + when service_category_2 = 'Emergency Department' then 'Outpatient' + when service_category_2 = 'Home Health' then 'Outpatient' + when service_category_2 = 'Hospice' then 'Outpatient' + when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient' + when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient' + when service_category_2 = 'Lab' then 'Ancillary' + when service_category_2 = 'Office Visit' then 'Office Visit' + when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient' + when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient' + when service_category_2 = 'Skilled Nursing' then 'Inpatient' + when service_category_2 = 'Urgent Care' then 'Outpatient' + when service_category_2 is null then 'Other' + end service_category_1 + , case + when service_category_2 is null then 'Other' + else service_category_2 + end service_category_2 + , '{{ var('tuva_last_run')}}' as tuva_last_run + from {{ ref('service_category__stg_medical_claim') }} a + left join {{ ref('service_category__combined_institutional') }} b + on a.claim_id = b.claim_id + where a.claim_type = 'institutional' +) +, service_category_2_deduplication as( + select + claim_id + , claim_line_number + , claim_type + , service_category_1 + , service_category_2 + , row_number() over (partition by claim_id, claim_line_number order by + case + when service_category_2 = 'Acute Inpatient' then 3 + when service_category_2 = 'Ambulance' then 7 + when service_category_2 = 'Ambulatory Surgery' then 8 + when service_category_2 = 'Dialysis' then 17 + when service_category_2 = 'Durable Medical Equipment' then 1 + when service_category_2 = 'Emergency Department' then 5 + when service_category_2 = 'Home Health' then 9 + when service_category_2 = 'Hospice' then 10 + when service_category_2 = 'Inpatient Psychiatric' then 11 + when service_category_2 = 'Inpatient Rehabilitation' then 12 + when service_category_2 = 'Lab' then 13 + when service_category_2 = 'Office Visit' then 4 + when service_category_2 = 'Outpatient Hospital or Clinic' then 14 + when service_category_2 = 'Outpatient Psychiatric' then 15 + when service_category_2 = 'Outpatient Rehabilitation' then 16 + when service_category_2 = 'Skilled Nursing' then 6 + when service_category_2 = 'Urgent Care' then 2 + when service_category_2 is null then 18 + else 99 end) as duplicate_row_number + from claims_preprocessing.service_category_grouper +) -select distinct - a.claim_id -, a.claim_line_number -, a.claim_type -, case - when service_category_2 = 'Acute Inpatient' then 'Inpatient' - when service_category_2 = 'Ambulatory Surgery' then 'Outpatient' - when service_category_2 = 'Dialysis' then 'Outpatient' - when service_category_2 = 'Emergency Department' then 'Outpatient' - when service_category_2 = 'Home Health' then 'Outpatient' - when service_category_2 = 'Hospice' then 'Outpatient' - when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient' - when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient' - when service_category_2 = 'Lab' then 'Ancillary' - when service_category_2 = 'Office Visit' then 'Office Visit' - when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient' - when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient' - when service_category_2 = 'Skilled Nursing' then 'Inpatient' - when service_category_2 = 'Urgent Care' then 'Outpatient' - when service_category_2 is null then 'Other' - end service_category_1 -, case - when service_category_2 is null then 'Other' - else service_category_2 - end service_category_2 -, '{{ var('tuva_last_run')}}' as tuva_last_run -from {{ ref('service_category__stg_medical_claim') }} a -left join {{ ref('service_category__combined_institutional') }} b - on a.claim_id = b.claim_id -where a.claim_type = 'institutional' +select + claim_id + , claim_line_number + , claim_type + , service_category_1 + , service_category_2 +from service_category_2_deduplication +where duplicate_row_number = 1 \ No newline at end of file